Giter Club home page Giter Club logo

twinsenbot's Introduction

TwinsenBot

Twitter/Mastodon bot posting lines from the LBA games.

The bot in action:

This bot is inspired by the WAD BOT by JP LeBreton: https://bitbucket.org/JPLeBreton/wadbot

Twitter version

Getting the OAuth tokens

In order to get the user's OAuth token, you need to run the following in an interactive python session.

>>> api_key='__something__'
>>> api_secret='__something__'
>>> import tweepy
>>>
>>> auth = tweepy.OAuthHandler(api_key, api_secret)
>>> print auth.get_authorization_url()
https://api.twitter.com/oauth/authorize?oauth_token=__something__

Visit this page and authenticate with the twitter user you want to use, and get the PIN to use in the next command.

>>> print auth.get_access_token(__the_pin_here__)
oauth_token_secret=__something__&oauth_token=__something__
>>>

Or, simply create the twitter application with the target account so you can create OAuth tokens directly from the application management page.

Mastodon version

Put the application access token in a file name token.secret.

Quotes DB

The quote database was created from the game using one of the available HQR unpackers to produce the .lbt files. With the LBA Text Views from LBADeCOMP these files were dumped to individual text files.

The extract-quotes.py script parses these files to the quotes.db. The script is called with each file to process as an argument. It assumes the filenames have the following format: <game>/<id> <area>.txt for example: lba1/08 Citadel Island.txt.

So the script was executed as: ./extract-quotes.py lba1/* lba2/*

twinsenbot's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.