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

wont run #1

Open
jadedgnome opened this issue Nov 1, 2013 · 8 comments
Open

wont run #1

jadedgnome opened this issue Nov 1, 2013 · 8 comments

Comments

@jadedgnome
Copy link

at first i edited 'download_images.sh' and change workspace/bin/activate to bin/activate .

i ran the script a second time to receive another error .

/bin/twitter_download/download_images.sh: line 7: bin/activate: No such file or directory
Traceback (most recent call last):
File "bin/download_image.py", line 8, in
TWITTER = Twitter(get_config())
File "build/bdist.linux-i686/egg/download_twitter/twitter.py", line 21, in init
File "build/bdist.linux-i686/egg/download_twitter/api.py", line 132, in init
File "build/bdist.linux-i686/egg/download_twitter/api.py", line 37, in init
File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'main'
/bin/twitter_download/download_images.sh: line 7: deactivate: command not found

@zaurky
Copy link
Owner

zaurky commented Nov 1, 2013

hi jadedgnome,
this project is still under development, if you want it to run, you need to install a virtualenv in workspace directory
$> virtualenv workspace

then you need to install the dependencies in this virtualenv
$> source workspace/bin/activate
$> pip install -r pip-requires.txt

then you will need to create a config file ~/.twitter_image.conf (you should take conf/twitter_image.conf.tmpl as an exemple and change the keys in the main section to put yours - you will find helpfull informations in the first reply here : https://dev.twitter.com/discussions/631)

then the original version of the download_images.sh should work

@jadedgnome
Copy link
Author

I did what you said and I couldn't get it to work.. different error but progress is being made.

do I have to change:
[path]
data_dir: XXXX

or leave as is?

@zaurky
Copy link
Owner

zaurky commented Nov 2, 2013

yes you have to put a real value to data_dir (let say /path/to/data) and then you should mkdir the dirs

$> mkdir -p /path/to/data
$> cd /path/to/data
$> mkdir tweets images daily

@jadedgnome
Copy link
Author

i didn't search for a friend just #halloween

retrieve /tmp/ratelimit.pkl
retrieve /tmp/friends_last_id.pkl
retrieve /tmp/friends_list.pkl
retrieve /tmp/friends_weight.pkl
retrieve /tmp/list_content.pkl
Traceback (most recent call last):
File "bin/download_image.py", line 9, in
TWITTER.run()
File "/bin/twitter_download/download_twitter/twitter.py", line 61, in run
list_content, friend_in_list = self.get_list_content()
File "/bin/twitter_download/download_twitter/twitter.py", line 31, in get_list_content
return (self.listcontent['list_content'],
File "/bin/twitter_download/download_twitter/cache.py", line 56, in getitem
return self._internal.getitem(key)
KeyError: 'list_content'
backup /tmp/list_content.pkl
backup /tmp/friends_weight.pkl
backup /tmp/friends_list.pkl
backup /tmp/friends_last_id.pkl

##############################################################################
##############################################################################
backup /tmp/ratelimit.pkl

@zaurky
Copy link
Owner

zaurky commented Nov 3, 2013

Ok, there was a bug when the cache files where empty, I corrected it in :
9c00781

The thing is that you have to run that first to fill the list caches (twitter api ratelimit thoses call very low ...):
$> PYTHONPATH=. python ./bin/refresh_lists.py

Then, how did you just search for #halloween ? the code can't do that right now, did you patch it ?

@jadedgnome
Copy link
Author

python bin/refresh_lists.py
Traceback (most recent call last):
File "bin/refresh_lists.py", line 3, in
from download_twitter.config import get_config
ImportError: No module named download_twitter.config

i did tried "#halloween" i didn't know if wasn't supported

@zaurky
Copy link
Owner

zaurky commented Nov 3, 2013

don't forget the PYTHONPATH=. before

The thing I don't get is were you tell the script "#halloween" ?

@jadedgnome
Copy link
Author

ooh it seems I got ahead of myself I assumes the script could accept arguments ie. ./download_images.sh .

I ran

$> PYTHONPATH=/usr/bin/python /bin/twitter_download/bin/refresh_lists.py

ouput:

retrieve /tmp/ratelimit.pkl
retrieve /tmp/friends_last_id.pkl
retrieve /tmp/friends_list.pkl
retrieve /tmp/friends_weight.pkl
retrieve /tmp/list_content.pkl
https://api.twitter.com/1.1/friends/list.json {'api_call': 'https://api.twitter.com/1.1/friends/list.json', 'params': {'cursor': -1}, 'method': 'GET'}
https://api.twitter.com/1.1/lists/list.json {'api_call': 'https://api.twitter.com/1.1/lists/list.json', 'params': {}, 'method': 'GET'}
friends in not group :
CafeMiyamaBot, LexAcademy2011, google, yamanetoshi, tedtalks, twi_nomi, twitter, TechCrunch, gadgetlab, yasulab, WIRED, hanachin_, densyohonke, tango_bot, maruyama097, lapislazuli_787
backup /tmp/deleted_friends.pkl
backup /tmp/list_content.pkl
backup /tmp/friends_weight.pkl
backup /tmp/friends_list.pkl
backup /tmp/friends_last_id.pkl

##############################################################################
https://api.twitter.com/1.1/friends/list.json called 1 times
https://api.twitter.com/1.1/lists/list.json called 1 times
##############################################################################
backup /tmp/ratelimit.pkl

This entire time i was trying ./download_images.sh "Halloween"

retrieve /tmp/ratelimit.pkl
retrieve /tmp/friends_last_id.pkl
retrieve /tmp/friends_list.pkl
retrieve /tmp/friends_weight.pkl
retrieve /tmp/list_content.pkl
got 0 lists
16 friends in list
https://api.twitter.com/1.1/statuses/user_timeline.json {'api_call': 'https://api.twitter.com/1.1/statuses/user_timeline.json', 'params': {'count': 200, 'max_id': None, 'user_id': 157998689, 'since_id': None, 'include_rts': 1}, 'method': 'GET'}

it continued like that and download profile images to /tmp/images/

I'll wait to try it again when you get to download search term results. Thanks for the help though!

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

No branches or pull requests

2 participants