Skip to content

Othernet-Project/librarian-twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

librarian-twitter

A GUI for displaying downloaded twitter feeds.

Installation

The component has the following dependencies:

To enable this component, add it to the list of components in librarian's config.ini file, e.g.:

[app]
+components =
    librarian_twitter

And to make the menuitem show up:

[menu]
+main =
    twitter

Configuration

twitter.refresh_rate

The interval of performing checks for new tweets, specified in seconds. Example:

[twitter]
refresh_rate = 60
twitter.tweetdir

A filesystem path where downloaded tweets can be found. Example:

[twitter]
tweetdir = .appdata/tweets/

Development

In order to recompile static assets, make sure that compass and coffeescript are installed on your system. To perform a one-time recompilation, execute:

make recompile

To enable the filesystem watcher and perform automatic recompilation on changes, use:

make watch

Testing Tweets Locally

Familiarity with the Twitter API is advised, as it's the primary way of obtaining twitter data.

Tweets are just like any other file, but they live in .appdata/tweets. They also get deleted immediately after ingestion. Tweets are a json notation text file that use 5 keys in an array. The keys are:

name value
date Date of broadcast, yyyy-mm-dd format
handle Name of person who tweeted without the @
id Twitter ID of the tweet in question
text Content of the tweet
time Time the tweet occured, hh:mm:ss format
img Extension of an image, if attached

An example tweet:

{
    "date": "2015-03-17",
    "handle": "BreakingNews",
    "id": "577895032209960960",
    "text": "RT @breakingpol: Illinois Rep. Aaron Schock is resigning his seat in Congress - @politico http://t.co/sgCkJiSSyP",
    "time": "18:11:27"
    "img": "png"
}

Images may be provided and must be named <tweet id>.<image extension>. For example, if we have a tweet-id of 577895032209960960 and an image extension of .png, the file name would be 577895032209960960.png and it would belong at the path .appdata/tweets/img/577895032209960960.png.