https://github.com/heathd/twitter_thread_getter
Given a tweet ID gets replies to that tweet and counts up all the links referenced in those tweets
https://github.com/heathd/twitter_thread_getter
ruby twitter
Last synced: 10 months ago
JSON representation
Given a tweet ID gets replies to that tweet and counts up all the links referenced in those tweets
- Host: GitHub
- URL: https://github.com/heathd/twitter_thread_getter
- Owner: heathd
- License: mit
- Created: 2020-07-04T11:05:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T15:12:58.000Z (over 3 years ago)
- Last Synced: 2023-03-11T11:57:01.779Z (over 3 years ago)
- Topics: ruby, twitter
- Language: Ruby
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twitter Thread Getter
Given a tweet ID this script will:
1. fetch all replies to that thread using the twitter API
2. resolve any t.co urls to the original url
3. fetch the referenced URLS and extract the Title page (or title from meta tag for Youtube urls)
4. collate stats about the referenced urls counting up how many times each url is referenced, and also recording the twitter handles of people who referenced each url
Logging output is sent to STDERR
Program output is sent to STDOUT in the form of a CSV file
## Dependencies
- ruby
- `t` gem (`gem install t`)
## Authentication
You must authenticate to twitter using the `t` command line program to set up your twitter credentials. See https://github.com/sferik/t#configuration for details
## Usage
```
$ ./bin/collate_stats 1278537744352862208 > stats.csv
I, [2020-07-04T12:02:22.400613 #80901] INFO -- : Fetching tweets...
I, [2020-07-04T12:02:22.838022 #80901] INFO -- : Collating tweets in 20 threads
```
## Errors
If you exceed your rate limit you may get
```
...request.rb:97:in `fail_or_return_response_body': Rate limit exceeded (Twitter::Error::TooManyRequests)
```