|
Automating your Search for Pictures to Graduate
 |
I posted this to a few of the Views groups to make sure everyone would get a chance to read it, but I didn't post it to all of them because that'd be way too much repeated info.
So, I created a script that goes through the different views groups and tells the user which ones are ready to graduate to the next group. I use it every day on the commandline, but I wanted to share with others, so I put it on the web.
Right now I have it set up to search only one group at a time. It takes a while to search through all of your pictures if you have a lot in a particular group and doing it all at once times out my server.
With groups where I have only a few photos, it takes a few seconds. With groups where I have 400+ photos, it takes a few minutes. (Or may completely timeout the web version - sorry about that - I'm not sure what to do about it for now)
I've done most of the web part of the coding tonight and it's incredibly late so I'm sure there are still some bugs to work out. Check it out at server.ericsbinaryworld.com/cgi-bin/flickr_views.cgi
and let me know what you think!
Thanks! and I hope this is helpful to the users.
Posted at 10:46PM, 6 May 2008 PST
(
permalink
)
|
 |
this is great, thanks bro...
Posted 19 months ago.
(
permalink
)
|
 |
I am trying this out now, it looks like a brilliant idea!
Posted 19 months ago.
(
permalink
)
|
 |
OK, that worked really well.
It does look like you have missed out views 50 though, but as you said there are some bugs.
How about a development of this? If you changed the setting from images with enough views to graduate, could you set it so it finds images ready to go into the ready to graduate thread? i.e. images with 45 views that are in the views 25 thread can be put into the ready to grad thread to get a bit of a helpful push up to the next group. That would be really helpful too.
Fantastic script, well done.
Posted 19 months ago.
(
permalink
)
|
 |
One thing that could be sorted out is the way you have to authenticate your account every single time you want to run a new group...
Posted 19 months ago.
(
permalink
)
|
 |
I just found a glitch - when you check for the views 4000 group, rather than find images that have graduated, it just found the pictures in the group. (All three of them!)
Otherwise, brilliant.
Posted 19 months ago.
(
permalink
)
|
 |
Thanks Jasmic, I'll check out the bugs - hopefully later today. The 4000 is not so much a glitch as a matter of the fact that that's how high I go and I adapted it from a personal script. I'll get to that also, hopefully today.
Posted 19 months ago.
(
permalink
)
|
 |
just perfect
thank you!
Posted 19 months ago.
(
permalink
)
|
 |
Excellent work! Thanks!
Posted 19 months ago.
(
permalink
)
|
 |
thanks Julian and Alan. I'm glad I put it out there.
Posted 19 months ago.
(
permalink
)
|
 |
ok, I fixed the views50 and 4000 bugs. As far as the authentication per new group, I'll work on that over the next couple of days. I think it's an easy fix, but I don't feel like debugging it tonight if it doesn't work.
Posted 19 months ago.
(
permalink
)
|
 |
Thanks. What a great program. Found a few in the wrong groups that had slipped under my graduating radar.
Posted 18 months ago.
(
permalink
)
|
 |
I just found a work around for not having to re-authenticate everytime you want to search another group.
Just click the back button on your browser.
Posted 18 months ago.
(
permalink
)
|
 |
Glad to help Fe em.
Posted 18 months ago.
(
permalink
)
|
 |
One of my pictures just broke the script! The title is the problem...
"Heiße Schokolade ohne Sahne" - it is the ß doing the damage.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 18: ordinal not in range(128)
args = ('ascii', u'Title: Hei\xdfe Schokolade ohne Sahne\tVi...tp://www.flickr.com/photos/jasmic/1745660158/', 18, 19, 'ordinal not in range(128)')
encoding = 'ascii'
end = 19
object = u'Title: Hei\xdfe Schokolade ohne Sahne\tVi...tp://www.flickr.com/photos/jasmic/1745660158/'
reason = 'ordinal not in range(128)'
start = 18
Posted 18 months ago.
(
permalink
)
|
 |
hmm....I'll have to see what I need to do, I know I previously had a hard time with another python cgi script with unicode. I'm pretty sure I can fix it. Darn computer designers, being all US-centric and giving other languages the back seat until recently....
Posted 18 months ago.
(
permalink
)
|
 |
I had the same problem with the ë in the word "Citroën".....
UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 20: ordinal not in range(128)
args = ('ascii', u'Title: Citro\xebn DS Break Familiale\tVie...ww.flickr.com/photos/42057291@N00/2399219194/', 20, 21, 'ordinal not in range(128)')
encoding = 'ascii'
end = 21
object = u'Title: Citro\xebn DS Break Familiale\tVie...ww.flickr.com/photos/42057291@N00/2399219194/'
reason = 'ordinal not in range(128)'
start = 20
But I'm very pleased with your program all the same..... Thanks!
Posted 18 months ago.
(
permalink
)
|
 |
Very nice!
Posted 18 months ago.
(
permalink
)
|
 |
those with non-English characters - I'll be getting to it soon, I've been busy with other things such as my brother's graduation
Posted 18 months ago.
(
permalink
)
|
 |
ok, I think I fixed it. I don't have any photos I could use to test it. Let me know if it still breaks on unicode characters.
Posted 18 months ago.
(
permalink
)
|
 |
Thanks for a great little applicaiton.
I still get the error:
UnicodeDecodeError Python 2.4.3: /usr/local/bin/python
Thu Jun 12 19:41:15 2008
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/usr/local/www/apache22/cgi-bin/flickr_views.cgi
169 if formviews == 'views25':
170 (gp, nfo) = analyzeviews(views[0] )
171 printviews(views[1], gp, nfo)
172 elif formviews == 'views50':
173 (gp, nfo) = analyzeviews(views[1] )
printviews = , views = ('14813384@N00', '63923506@N00', '26651003@N00', '37045109@N00', '35419517@N00', '76852794@N00', '97866666@N00', '32266655@N00', '50687206@N00', '65104419@N00', '87608476@N00', '79303709@N00', '85342170@N00', '66448677@N00', '18374590@N00', '25661400@N00', '44588749@N00', '10386539@N00', '69218008@N00', '52498228@N00', ...), gp = , nfo = [, , , , , , , , , , , , , , , , , , , , ...]
/usr/local/www/apache22/cgi-bin/flickr_views.cgi in printviews(vgroup='63923506@N00', group=, info=[, , , , , , , , , , , , , , , , , , , , ...])
64 for n in range(0,len(info)):
65 if int(info[n].photo[0]['views']) > numerical_views[vgroup]:
66 print "Title: " + group.photos[0].photo[n]['title'].encode("utf8") + "\tViews: " + info[n].photo[0]['views'] + "\tURL: " + info[n].photo[0].urls[0].url[0].text + ""
67 print ""
68
group = , group.photos = [], ].photo undefined, n = 191, ].encode undefined, info = [, , , , , , , , , , , , , , , , , , , , ...]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 32: ordinal not in range(128)
args = ('ascii', 'Title: traveling on the \xe9\x95\xbf\xe6\xb1\x9f\tViews: ', 32, 33, 'ordinal not in range(128)')
encoding = 'ascii'
end = 33
object = 'Title: traveling on the \xe9\x95\xbf\xe6\xb1\x9f\tViews: '
reason = 'ordinal not in range(128)'
start = 32
Posted 17 months ago.
(
permalink
)
|
 |
yewenyi (文意) - thanks for reporting that, I'll get to it in a free moment.
Posted 17 months ago.
(
permalink
)
|
 |
And another bug for when you have the time and inclination ;-)
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/usr/local/www/apache22/cgi-bin/flickr_views.cgi
226 elif formviews == 'views5000':
227 (gp, nfo) = analyzeviews(views[20] )
228 printviews(views[21], gp, nfo)
229 elif formviews == 'views10000':
230 (gp, nfo) = analyzeviews(views[-1] )
printviews = , views = ('14813384@N00', '63923506@N00', '26651003@N00', '37045109@N00', '35419517@N00', '76852794@N00', '97866666@N00', '32266655@N00', '50687206@N00', '65104419@N00', '87608476@N00', '79303709@N00', '85342170@N00', '66448677@N00', '18374590@N00', '25661400@N00', '44588749@N00', '10386539@N00', '69218008@N00', '52498228@N00', ...), gp = , nfo = []
IndexError: tuple index out of range
args = ('tuple index out of range',)
Superb work by the way.
Posted 17 months ago.
(
permalink
)
|
 |
interesting...I'll definitely need to debug that. Where oh where is the time to do these things? hopefully this weekend....
Posted 16 months ago.
(
permalink
)
|
 |
Ok, I still have to hunt down the tuple error. However, have I fixed the unicode problem? If you have chinese, etc characters it will just display a message telling you that you have unicode characters. It will no longer error out.
At least it shouldn't if I did this correctly. Please let me know if it's working as I don't have any photos with non-latin characters.
Posted 16 months ago.
(
permalink
)
|
 |
My server crashed a few weeks ago and I've migrated to a new server. As of now, the script does not correctly work.
Posted 10 months ago.
(
permalink
)
|
 |
Sweet little tool!
But I get an error when I try to run for the Views25 group. But it works fine for the other groups.
Posted 10 months ago.
(
permalink
)
|
 |
As soon as I authenticated, but before I could choose a group, I got this:
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/var/www/cgi-bin/flickr_views.cgi
162 htmlhead()
163 print "You have now been authorized. Now pick which group you want to check to see if your pictures are ready to graduate."
164 token = initialize()
165 checkedtoken = flickr.auth_checkToken(auth_token = token)
166 user = checkedtoken.auth[0].user[0]['nsid']
token undefined, initialize =
/var/www/cgi-bin/flickr_views.cgi in initialize()
45 #print response["frob"].value
46 frob = response["frob"].value
47 token = flickr.get_token(frob)
48 return token
49
token undefined, global flickr = [FlickrAPI for key "576fd8dc92790d402ea52e08b76d49bd"], flickr.get_token = , frob = '72157613835233360-9c0cad4cf69074ff-24827236'
/usr/lib/python2.4/site-packages/flickrapi/__init__.py in get_token(self=[FlickrAPI for key "576fd8dc92790d402ea52e08b76d49bd"], frob='72157613835233360-9c0cad4cf69074ff-24827236')
727 rsp = self.auth_getToken(frob=frob, auth_token=None, format='xmlnode')
728
729 token = rsp.auth[0].token[0].text
730 LOG.debug("get_token: new token '%s'" % token)
731
token undefined, rsp = , rsp.auth undefined
AttributeError: XMLNode instance has no attribute 'auth'
args = ("XMLNode instance has no attribute 'auth'",)
Posted 9 months ago.
(
permalink
)
|
 |
Here's the authentication error I get
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/var/www/cgi-bin/flickr_views.cgi
164 token = initialize()
165 checkedtoken = flickr.auth_checkToken(auth_token = token)
166 user = checkedtoken.auth[0].user[0]['nsid']
167 form2(token, user)
168 htmltail()
user = '0', checkedtoken = , checkedtoken.auth undefined
AttributeError: _ElementInterface instance has no attribute 'auth'
args = ("_ElementInterface instance has no attribute 'auth'",)
Posted 9 months ago.
(
permalink
)
|
 |
When would it be fixed? Now I would only use Flickr Groopy for similar functionality. But I think your script is much better! ;-)
Posted 3 months ago.
(
permalink
)
|
 |
hey guys, great news! I finally fixed it! The api I use switched the frameworks underpinning it, so it was very hard for me to changeup my code, but it's now working. Send any bugs to me via flickr email.
Posted 3 months ago.
(
permalink
)
|
 |
It is a great tool and I am happy that you fixed most of the problems and I love to use the tool again.
There is still a problem for groups where are I got a very large numbers of photos. In the group Views 25 I got 1.797 photo's and the tool is showing this correctly, but it is showing only 1 photo ready for graduation and I know there are more.
Posted 2 months ago.
(
permalink
)
|
 |
great stuff! I immediately found out that i am a lot behind :((((
But that's of course good news :D
Really thx !
This also works for the fav groups ?
Posted 6 weeks ago.
(
permalink
)
|
Would you like to comment?
Sign up for a free account, or sign in (if you're already a member).
|
|