My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

The whole concept of Twerp is to allow your Twitter (or Laconi.ca) data stream to be pulled, formatted via a template you can control and then output to the console.

It also allows you to post a status message or send a direct message.

That's it in a nutshell.

You can access the following data streams:

  • Friends Timeline
  • Your Timeline
  • Your Replies
  • Direct Messages sent to you

Options:

    -c  --config    <filename>  Location of the configuration file.
                                The default file ~/.twerp.cfg is created
                                and populated the first time you run Twerp.
    -U  --username  <name>      User ID - needed only the first time
                                you run Twerp as Twerp will save the value.
    -P  --password  <password>  Account Password - also only needed once.
    -T  --template  <text>      Template string.  This string is used to
                                format the data received from Twitter.
                                Details on the format can be found below.
    -d  --direct    <message>   Send a direct message.
    -t  --timeline              Twerp will ouput your timeline.
    -f  --friends               Twerp will output your friend's timeline.
    -r  --replies               Twerp will output replies to you.
    -p  --public                Twerp will output the public timeline.
    -u  --url       <api url>   Twitter compatible API

Examples:

    twerp -U bear -P sekrit -f
    twerp -frp
    twerp status message to post
    twerp -d decklin direct message to decklin

Template Format

If you are familiar with how Python specifies the format string then you know exactly how this works :)

Each post coming from Twitter has the following parts:

    Field                   Template
    user_id                 %(user_id)s
    user_name               %(user_name)s
    user_screen_name        %(user_screen_name)s
    user_description        %(user_description)s
    user_location           %(user_location)s
    user_protected          %(user_protected)s
    user_url                %(user_url)s
    user_profile_image_url  %(user_profile_image_url)s
    id                      %(id)s
    text                    %(text)s
    source                  %(source)s
    created_at              %(created_at)s

The parts of each post is stored in a dictionary and then passed to Python as the formatted data source. To reference the parts, place a field reference in your template string.

The default template string is: %(user_screen_name)s: %(text)s

Powered by Google Project Hosting