Lurk all you'd like, but why not register and post some pics? Registering also makes it easier to find the good stuff. Need help?

Go Back   Digital Grin Photography Forum > Support > SmugMug APIs, Hacks & Tricks
Dgrinner
Password
Register FAQ Shooters Calendar Reviews Tutorials Gallery Books Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old Jun-05-2008, 08:32 AM   #1
pth
working on it
 
pth's Avatar
 
Join Date: Nov 2007
Posts: 33
All keywords

I think I know the answer to this question, but I want to be wrong :-)

Is there an API method to collect all keywords (better yet with their usage count)? There is a tag cloud on the homepage, so this data is available, but shy of collecting all albums and their photos, I do not see how I could gather this information with the API.

Thanks
pth
pth is offline   Reply With Quote
Old Jun-11-2008, 10:23 AM   #2
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Quote:
Originally Posted by pth
I think I know the answer to this question, but I want to be wrong :-)

Is there an API method to collect all keywords (better yet with their usage count)? There is a tag cloud on the homepage, so this data is available, but shy of collecting all albums and their photos, I do not see how I could gather this information with the API.

Thanks
pth
Unfortunately not. You'd have to create your own function that effectively trawled through all the images/albums and grab the keywords. This would be very painful and time consuming so I wouldn't recommend it.
__________________
Colin Seymour
Personal Blog | Tech Blog | phpSmug
lildude is offline   Reply With Quote
Old Jun-12-2008, 12:26 PM   #3
bziclix
Big grins
 
Join Date: May 2007
Posts: 19
pysmug implementation of tagcloud()

Quote:
Originally Posted by lildude
Unfortunately not. You'd have to create your own function that effectively trawled through all the images/albums and grab the keywords. This would be very painful and time consuming so I wouldn't recommend it.
I decided to write such a function for pysmug and it turned out to be both easy and fast if you use batchables. I can build a dictionary of {keyword:count} for over 80 galleries and 3200+ photos in less than 30 seconds -- depends on your definition of fast of course. The function takes an optional keyword parsing function since keywords appear to be variable in format.

I added this for the 0.5 release of pysmug, but it will work perfectly well with version 0.4 (code here, look for "tagcloud").

Use it like this:

Code:
>>> import pysmug
>>> m = pysmug.login(klass=pysmug.SmugTool)
>>> print m.tagcloud()
thanks, brian

--
Brian Zimmer / bzimmer.ziclix.com
bziclix is offline   Reply With Quote
Old Jun-12-2008, 03:54 PM   #4
bziclix
Big grins
 
Join Date: May 2007
Posts: 19
I added a slightly longer write-up here detailing the performance of pysmug for generating the tag cloud.

thanks, brian
__________________
Brian Zimmer / bzimmer.ziclix.com
bziclix is offline   Reply With Quote
Old Jun-20-2008, 12:52 AM   #5
darryl
Major grins
 
Join Date: May 2004
Posts: 1,033
Wouldn't it be faster to just scrape your Keywords page?

http://yoursite.smugmug.com/keyword/

--Darryl
darryl is offline   Reply With Quote
Old Jun-20-2008, 07:28 AM   #6
bziclix
Big grins
 
Join Date: May 2007
Posts: 19
Quote:
Originally Posted by darryl
Wouldn't it be faster to just scrape your Keywords page?

http://yoursite.smugmug.com/keyword/

--Darryl
Why scrape when you can get reliable structured content from the API?
__________________
Brian Zimmer / bzimmer.ziclix.com
bziclix is offline   Reply With Quote
Reply

Tell The World!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Times are GMT -8.   It's 09:38 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.