Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

[REQUEST] Reverse results #403

Open
NoSuck opened this issue Apr 28, 2019 · 5 comments
Open

[REQUEST] Reverse results #403

NoSuck opened this issue Apr 28, 2019 · 5 comments

Comments

@NoSuck
Copy link
Contributor

NoSuck commented Apr 28, 2019

A --reverse option would be useful because it would facilitate updating an already downloaded collection of tweets. By default, --resume proceeds from newest to oldest. Therefore, --resume LAST_DOWNLOADED_TWEET downloads every tweet since the beginning. On the other hand, a --reverse option would cause --resume to proceed from oldest to newest. Therefore, --reverse --resume LAST_DOWNLOADED_TWEET would download every tweet that had not already been downloaded.

If this functionality already exists, please tell me.

@pielco11
Copy link
Member

Hi @NoSuck

Twitter returns first the newest tweets, and then go back. So a --reverse feature would be like setting since and until from the past to the beginning. This process is not automated, but could still be achieved with a few lines of code

@NoSuck
Copy link
Contributor Author

NoSuck commented Apr 29, 2019

Thank you for the insight. If you approve of this functionality, I would like to at least try to put together a PR. Unfortunately, motivation levels have been lowered by having already shell-scripted around this. 😅

@pielco11
Copy link
Member

Sure, no worries, feel free to provide any kind of contribute! Even a script or something could be fine, I guess. In my opinion, it does not have not be something inside the Python package. For me, it could be easier to play with some scripting

@RomeuG
Copy link

RomeuG commented Aug 14, 2019

@NoSuck While there is no feature, I use this script to update a collection of tweets from 1 user:

#!/bin/sh

twitter_handle=$1
file_name="${twitter_handle}.twitter"
temp_name="${file_name}.tmp"

date=$(cat $file_name | head -n 1 | cut -d' ' -f2)
results=$(twint -u $twitter_handle --since $date)

echo "$results
$(cat $file_name)" > $file_name

sort -n -r -u -t ' ' -k1 $file_name > $temp_name
mv $temp_name $file_name

EDIT: I am sure many things could be improved, but I do not have any kind of issues with that script.

@NoSuck
Copy link
Contributor Author

NoSuck commented Aug 16, 2019

Thanks, @RomeuG. This is what I ended up doing. It's been real nice so far. Sorry for not posting earlier, @pielco11.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants