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

scrap particular hashtag on basis of date #597

Closed
riishabhz opened this issue Dec 6, 2019 · 25 comments
Closed

scrap particular hashtag on basis of date #597

riishabhz opened this issue Dec 6, 2019 · 25 comments
Labels
Compatibility Issue not related to Twint standalone but to an integration of Twint into other stuff Known Issue Workaround Added a solution to a problem, should dive in

Comments

@riishabhz
Copy link

hello
i have used this command:- twint -s pineapple --since 2019-12-05 -o file.csv --csv
but i am getting error like this:-
return datetime.datetime.strptime(date, "%Y-%m-%d").strftime('%s')
valueError: Invalid format string

what could be the possible solution ?

@pielco11
Copy link
Member

pielco11 commented Dec 6, 2019

I'm unable to replicate your issue, also your syntax seems to be correct

@riishabhz
Copy link
Author

yes i know but its not working , can you check is it working on your script.

@pielco11
Copy link
Member

pielco11 commented Dec 6, 2019

immagine

I just changed the since field to get some results

@riishabhz
Copy link
Author

nope not working in my case :(
twint

@pielco11
Copy link
Member

pielco11 commented Dec 6, 2019

I guess there's an incompatibility issue with Windows then

@pielco11 pielco11 added the Compatibility Issue not related to Twint standalone but to an integration of Twint into other stuff label Dec 6, 2019
@riishabhz
Copy link
Author

riishabhz commented Dec 6, 2019 via email

@pielco11
Copy link
Member

pielco11 commented Dec 6, 2019

As of now I suggest to not run on Windows

I've some ideas like raw text splitting

@riishabhz
Copy link
Author

ok , please update me when its fixed :)

@Ali-khavanin
Copy link

@pielco11
That's exactly what i was referring to.
And if i may ask a question :
How can i use timeDelta instead of Since and Until.

Cause those 2 doesn't seem working 😕

@pielco11
Copy link
Member

@Ali-khavanin I removed timeDelta from the code since it was causing various issues, I'll push a workaround for Windows users

pielco11 added a commit that referenced this issue Dec 10, 2019
@pielco11
Copy link
Member

Not having a Windows machine is quite limiting me, so I kindly ask you to retry now (git clone or pip+git) and let me know if something has changed

@riishabhz
Copy link
Author

hello
i have cloned the project but still same result.
twint

@Ali-khavanin
Copy link

hello
i have cloned the project but still same result.
twint

hi there!
i don't exactly know why but if u use the same command on ubuntu it would work properly!
i tried it on a virtual box

@riishabhz
Copy link
Author

hello
i have cloned the project but still same result.
twint

ooh ok cool , will try on linux now, thanx for the information :)

@pielco11
Copy link
Member

The issue is not fixed yet, I'll reopen this

@pielco11 pielco11 reopened this Dec 11, 2019
@riishabhz
Copy link
Author

The issue is not fixed yet, I'll reopen this

my bad :p

pielco11 added a commit that referenced this issue Dec 11, 2019
pielco11 added a commit that referenced this issue Dec 11, 2019
@pielco11
Copy link
Member

pielco11 commented Dec 11, 2019

So, since Windows users are having issues while converting the formatted date to epoch, I removed the option to filter by hour. Now it should work as expected; an example for since and until is 2019-12-11, for non-Windows users 2019-12-11 12:00:00 is possible. What I've done should be considered as a workaround and not a solution

@riishabhz
Copy link
Author

So, since Windows users are having issues while converting the formatted date to epoch, I removed the option to filter by hour. Now it should work as expected; an example for since and until is 2019-12-11, for non-Windows users 2019-12-11 12:00:00 is possible. What I've done should be considered as a workaround and not a solution

so should i clone again?

@pielco11
Copy link
Member

pielco11 commented Dec 11, 2019

@riishabhz yes, or even just git pull

@riishabhz
Copy link
Author

i have done git clone ,still same results , not able to do

@pielco11
Copy link
Member

@riishabhz may you post the error message please?

@riishabhz
Copy link
Author

i sort it out , i dont know why it wasnt updating from git so i copy pasted your code in url.py file and now its working :) thanx a lot @pielco11

@pielco11 pielco11 added Known Issue Workaround Added a solution to a problem, should dive in labels Dec 11, 2019
@pielco11
Copy link
Member

#605

@dataslug1
Copy link

Hi,
I am having this same issue even with latest version, I am using windows PC.
Is there maybe any workaround we can do by defining the dates using the DateTime module?
Thank you

Code and errors:

import twint
searchterm = 'Barcelona'
config = twint.Config()
config.Search = searchterm
config.Lang = "en"
config.Limit = 100
config.Since = "2019–3–24"
config.Until = "2019–3–25"
config.Store_csv = True
config.Output = searchterm+".csv"
twint.run.Search(config)

Traceback (most recent call last):
File "D:\user\Documents\Twintproject\Working.py", line 13, in
twint.run.Search(config)
File "D:\user\Documents\Twintproject\venv\lib\site-packages\twint\run.py", line 410, in Search
run(config, callback)
File "D:\user\Documents\Twintproject\venv\lib\site-packages\twint\run.py", line 329, in run
get_event_loop().run_until_complete(Twint(config).main(callback))
File "D:\user\Documents\Twintproject\venv\lib\site-packages\twint\run.py", line 38, in init
self.d = datelock.Set(self.config.Until, self.config.Since)
File "D:\user\Documents\Twintproject\venv\lib\site-packages\twint\datelock.py", line 30, in Set
d.until = datetime.datetime.strptime(convertToDateTime(Until), "%Y-%m-%d %H:%M:%S")
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2020–3–25 00:00:00' does not match format '%Y-%m-%d %H:%M:%S'

@minamotorin
Copy link

You should use - (hyphen-minus), not (en-dash).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Compatibility Issue not related to Twint standalone but to an integration of Twint into other stuff Known Issue Workaround Added a solution to a problem, should dive in
Development

No branches or pull requests

5 participants