Skip to main content

Generate a static HTML website from your twitter time line

Project description

http://img.shields.io/pypi/v/static_tl.png

What is it?

It’ a tool that makes sure your TL won’t be gone for ever if for some reason twitter decides to no longer play nice.

In a way, it also makes it possible to:

  • edit your tweets

  • have them longer than 140 characters

Show me!

Here’s an example of static_tl in action:

http://dmerej.info/tweets

How to use it ?

  • Install Python3 and then install static_tl with pip

  • Create an app on http://apps.twitter.com

  • Edit ~/.config/static_tl.toml to have something like:

    [auth]
    api_key = "<Consumer Key>"
    api_secret = "<Consumer Secret>"
    
    token = "<Acces Token>"
    token_secret = "<Acess Token Secret>"
    
    [[users]]
    
    [users.user_one]
    with_replies = false
    
    [users.user_two]
    with_replies = true
  • Then run:

    static-tl get

This will generate some files with your recent tweets in a json folder.

For instance, if your run it on 2016 October 10, you’ll get two files:

  • json/<user>/2016-09.json (all the tweets from September)

  • json/<user>/2016-10.json (all the tweets from October so far)

  • Next time you’ll run static-tl get, we will look at the most recent status ID in the most recent .json file and only fetch new tweets. This means you can edit or even delete the tweets that are older than that :)

  • Then, when you are ready you can generate a completely static copy of your TL with:

    static-tl gen

(By static, we mean that it’s possible to upload those html files wherever you want so it’s extremely easy to publish your new TL on the web)

Tweaking the output

Customization can be done by simply editing the Jinja templates in static_tl/templates.

From the template you have access to all the fields returned by the official twitter API.

Also, any file not ending with .html in the templates folder will be copied directly to the html folder: useful for images, css files and the like.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

static_tl-0.3.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

static_tl-0.3.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file static_tl-0.3.1.tar.gz.

File metadata

  • Download URL: static_tl-0.3.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for static_tl-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ba3265887f1439a79ab3a5c21058291d7cf9233ae2dbc5ac05755d09864d7451
MD5 2a6f83b7512ddd3a01b505dacf60025e
BLAKE2b-256 f0b70c3e9ebfd71fac0910ac5b71e4cb758de134cc1eb6210283373a409104e8

See more details on using hashes here.

File details

Details for the file static_tl-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for static_tl-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6d7a874c483405a88c5185c2a7ccdfbd70ab2405cb5149cb937304ecd771be1
MD5 ef20f8dd7638df7fde5b84eee96a1313
BLAKE2b-256 767c330aa8252c1672479e0dd8bafb98ce9ae981085a4f0e6392c26af934c334

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page