Spaces:
Sleeping
Sleeping
license: mit | |
title: Tweet-Wayback | |
sdk: streamlit | |
emoji: π | |
colorFrom: yellow | |
colorTo: indigo | |
app_file: app.py | |
# Wayback Tweets | |
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12528448.svg)](https://doi.org/10.5281/zenodo.12528448) [![PyPI](https://img.shields.io/pypi/v/waybacktweets)](https://pypi.org/project/waybacktweets) [![docs](https://github.com/claromes/waybacktweets/actions/workflows/docs.yml/badge.svg)](https://github.com/claromes/waybacktweets/actions/workflows/docs.yml) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://waybacktweets.streamlit.app) | |
Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing (see [Field Options](https://claromes.github.io/waybacktweets/field_options.html)), and saves the data in HTML (for easy viewing of the tweets using the `iframe` tag), CSV, and JSON formats. | |
## Installation | |
```shell | |
pip install waybacktweets | |
waybacktweets --from 20150101 --to 20191231 --limit 250 jack | |
from waybacktweets import WaybackTweets, TweetsParser, TweetsExporter | |
USERNAME = "jack" | |
api = WaybackTweets(USERNAME) | |
archived_tweets = api.get() | |
if archived_tweets: | |
field_options = [ | |
"archived_timestamp", | |
"original_tweet_url", | |
"archived_tweet_url", | |
"archived_statuscode", | |
] | |
parser = TweetsParser(archived_tweets, USERNAME, field_options) | |
parsed_tweets = parser.parse() | |
exporter = TweetsExporter(parsed_tweets, USERNAME, field_options) | |
exporter.save_to_csv() |