Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get newest tweets with keyword #14

Open
FsxShader2012 opened this issue Apr 17, 2022 · 6 comments
Open

Get newest tweets with keyword #14

FsxShader2012 opened this issue Apr 17, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@FsxShader2012
Copy link

I'm using this awesome lib to get the newest tweets containing certain keywords. If you don't supply values for "since" and "until" you will get the same tweets everytime - the first tweets of the current day. I managed to get around that by deleting the since and until part from the search URL but that is certainly not intended 😄

Could you maybe add a live feature so your code doesn't get corrupted by me? 😆

@shaikhsajid1111
Copy link
Owner

Yeah, I've set it to start searching keywords from the last 24h from the current time. I see. it's a good proposal, I'll implement it to find from the current time itself. You may expect this change from the next release 😄

@shaikhsajid1111 shaikhsajid1111 added the enhancement New feature or request label Apr 17, 2022
@FsxShader2012
Copy link
Author

Thanks, appreciate it 😄
Another, question / suggestion: Time based searches? E.g. 2022-04-17-17:16:00

@shaikhsajid1111
Copy link
Owner

It doesn't depends on me but Twitter, if they've time based searches, it'll be possible to implement 😅

@FsxShader2012
Copy link
Author

Seems possible: https://github.com/igorbrigadir/twitter-advanced-search/
Honestly, all the operators from the time class would be interesting to me 🤔

@shaikhsajid1111
Copy link
Owner

shaikhsajid1111 commented Apr 18, 2022

Search keywords based on some time, yeah it is already available. You can pass since and until the argument to scrap tweets within some time range.
For example:

from twitter_scraper_selenium import scrap_keyword
#scrap 10 posts by searching keyword "#nasa" from date 30th August,2021 till date 31st August,2021
nasa = scrap_keyword(keyword="#nasa", browser="firefox",
                      tweets_count=10,output_format="json" ,until="2021-08-31", since="2021-08-30")
print(nasa)

@FsxShader2012
Copy link
Author

True, I was speaking of these operators or am I just blind? 🙈

Class Operator Finds Tweets… Eg:
Time since_time:1142974200 On or after a specified unix timestamp in seconds. Combine with the "until" operator for dates between. Maybe easier to use than since_id below. 🔗
  until_time:1142974215 Before a specified unix timestamp in seconds. Combine with a "since" operator for dates between. Maybe easier to use than max_id below. 🔗
  since_id:tweet_id After (NOT inclusive) a specified Snowflake ID 🔗
  max_id:tweet_id At or before (inclusive) a specified Snowflake ID (see Note below) 🔗
  within_time:2d
within_time:3h
within_time:5m
within_time:30s
Search within the last number of days, hours, minutes, or seconds 🔗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants