Closed erangatennakoon closed 9 years ago
I'm using python v3.4.2
Hi erangatennakoon,
in Python3 filter() returns a filter object that's iterable but no list. Before reversing it, you have to transform it to a list.
Change line 56 from
timeline.reverse()
to
timeline = reversed(list(timeline))
Maybe I'll release a Python3 version as a separate branch in the future.
Hope that helps, basti2342
Hi basti2342.
It works fine, without any error. Thanks for the quick update.
I've noticed one thing. Each time when I run the code it didn't RT any tweet. There are new tweets with the hashtag that I've define. Can you please help me on that too. I did all the configurations as you explained.
So it doesn't retweet anything at all? That's bad. Does it list any tweets when you run it?
I don't know what modifications you made to make it work with Python3, so it's hard to say what's wrong. I just pushed my Python3 version to a new branch. check it out and tell me if that works for you.
If it's not working, your search_query config line could be helpful.
Regards, basti2342
I did a mistake, put as follows on line 56 of the original source
list(timeline).reverse()
Update the same source to Python3 and it works fine. Now I've to do some changes like continuous loop and stuff. I'll give a try and let you know in case.
Thanks a lot again.
My idea is to do the followings;
I did a mistake, put as follows on line 56 of the original source
list(timeline).reverse()
That fixes the error, but it's useless. You reverse a temporary list of timeline
that'll never get used anywhere. The timeline doesn't get reversed and the save point/last id's are not working as expected. Please have a look at my comment above.
My idea is to do the followings;
- Search with more than one hashtag, rather one.
This is already possible, but the config option is misleading. You can put any search query there, e.g.
beer OR wine from:whoever
Please have a look at https://search.twitter.com/ (especially "operators" and "advanced search"). You can use all of that.
- Continuous loop
You're free to do so, but have a look at the rate limits. I decided not to implement a continous loop, because I prefer to call a Python script via crontab (or something similar) rather than have a script with static sleep times running all the time.
Regards, basti2342
Yes I agree. I'll try my best to keep in the safe side and do this.
Thanks again for your help. I'll close this issue soon.
Hi,
I got the following error;
AttributeError: 'filter' object has no attribute 'reverse'
on the following line;
timeline.reverse()
Can you please help me to sort it out.