[mythtv-users] Sync live tweets to recording playback

Michael Robinson mike at robinsonhome.org
Sun Feb 20 16:38:39 UTC 2011


FYI,

I wrote a Java application for myself that I thought others folks
might enjoy.  The app will replay tweets in sync with the playback of
a recording.  For example, if you recorded the a program the night
before, you can run this app while watching it and the tweets that
were sent when the program was actually aired will be displayed in
sync with the recording.  You can get it here:

    http://digivim.com/dvm/products/mythtwit/MythTwit.zip

If you have any feedback, please feel free to let me know.  Here's the
help info:

$ java -jar MythTwit.jar -help

MythTwit displays Tweets in sync with a recording during playback.

When the application starts, it connects to MythTV's frontend.  It will wait
until a program is being viewed.  Once the program has started, it will search
through the tweets using the user names and/or files provided on the command
line.  Any tweets within the time frame of the program will be stored and
displayed when the associated time is reached in the program.  Rewind/Fast
Forward is supported, so tweets will be re-displayed as necessary

Currently, Twitter is not actively polled during the playback.  Therefore, if
you are watching a program whose recording is still in progress, you will not
get new tweets sent after the program has started.  This feature may be added
in the future.

Usage:

  java -jar MythTwit.jar <options>

Options:

  -myth_host <host address>
       Network address for the frontend

  -myth_port <host port>
       Network port for the frontend (default = 6546).
       This option in only needed if the frontend's port has been changed
       from the default.

  -tweet_user <user name>
       Twitter user name of a live tweeter to be followed.
       This option can be used more than once to follow multiple users.

  -tweet_file <file name>
       File of tweets in JSON format.
       This option is used if you have saved a local copy of tweets.
       For example, to save the last 200 tweets from Doug Benson to a file
       named "tweets.json":

       wget -o tweets.json
http://api.twitter.com/1/statuses/user_timeline.json? \
       screen_name=dougbenson&count=200

       See the Twitter API documentation for more search options.  This
       option can be used more than once to specify multiple files.

  -callback <command>
       System command to be called when a tweet is to be displayed.
       Three parameters will be passed to the command in the following order:
           <display name> = Originator's Twitter display name
                   <time> = Timestamp for the tweet (yyyy-MM-dd'T'HH:mm:ss)
                   <text> = The tweet's content

  -start_time <time>
       Override the program start time (yyyy-MM-dd'T'HH:mm:ss).
       This would be necessary if live tweets occurred at a different time
       than the recording.

  -display_time <time>
       The minimum time (in milliseconds) between calls to the
callback (default = 5000)

  -max_queued <count>
       The maximum nuber of tweets queued to be displayed (default = 3).
       This setting only matters if tweets are expected to be received at a high
       rate.  This could occur if you are following several sources.
By default,
       tweets are spaced out by 5 seconds (see -display_time).  If tweets are
       received at a faster rate than they can be displayed, then they
are queued
       until the number reaches this value.  The oldest tweet is deleted.
       Setting this value to zero allows an unlimited number of tweets to be
       queued

  -verbosity <level>
       Set the verbosity level:
        0 = Silent
        1 = Error messages only
        2 = Non-diagnosic messages (default)
       >2 = Higher value results in more diagnostic messages

  -version
       Print the version and exit

  -help | -h
       Print this menu and exit

Example:

    The following command will display tweets by Doug Benson by calling the
    script "display_tweet.sh":

    java -jar MythTwit.jar -myth_host 192.168.1.3 -tweet_user dougbenson \
    -callback display_tweet.sh


More information about the mythtv-users mailing list