You are here

flickr api

Backup your public Flickr photo metadata to MongoDB using backupPublicPhotoMetadataByDateAndUser

Submitted by Roland on Mon, 2012-02-27 01:19

If you know how to run MongoDB and ruby on your computer or your server, then backupPublicPhotoMetadataByDateAndUser.rb is a simple Ruby script to backup your Flickr metadata for yours (or anybody else's) Flickr public photos for a given time period. Simple (it doesn't replicate flickr's richness nearly as comprehensively as Aaron's parallel flickr) but effective because then you can with very very simple programming use the MongoDB query language to do useful Flickr queries such as:

1. give me all the photos in gastown

2. give me the square 75x75url of all photos in Vancouver tagged "yellow"

3. give me all the photos geo-tagged in the city of Vancouver taken in 2011 during the morning rush hour (e.g. if you wanted to do Eric Fisher-like  maps)

HOW TO RUN IT:

  1. Start up MongoDB and create some indexes: /Applications/mongodb-osx-x86_64-2.0.2/bin/mongo
    1. > db.photos.ensureIndex({id:1});
      > db.photos.ensureIndex({datetaken:1});
      > db.photos.ensureIndex({dateupload:1});
      > db.photos.ensureIndex({lastupdate:1});
  2. Set Environment variables to point to your MongoDB and your flickr api key and the userid e.g.
    1. export MONGO_PORT=27017
    2. export MONGO_HOST=127.0.0.1
    3. export FLICKR_DB=rtflickr # your flickr database name in Mongo DB
    4. export FLICKR_USER=yourfunnyFlickruserIdendinging@01
    5. create a flickr.conf file like this:
      1. Roland-Tanglaos-MacBook-Pro-2:mongoflickrbackup rolandtanglao$ cat flickr.conf
        api_key = a3b9eeatbeefdecafbad
  3. specify time and date to backup e.g. to backup your 2009 public photos:
    1. ./backupPublicPhotoMetadataByDateAndUser.rb 2009 1 1 2009 12 31  >backup.2009.stdout.txt 2>backup.2009.stderr.txt

Das Blinkenlights - Vancouver and San Francisco Video Style!

Submitted by Roland on Wed, 2011-05-25 00:08

As promised, videos of my San Francisco and Vancouver real-time HTML5 geotagged photo mashups driven by the great flickr and CloudMadeAPIs (each time a geotagged photo to the city is uploaded to flickr, a dot is posted on the map; the dot does a reverse blue fade-in and then alternates between green and red and the map alternates between orange and pink). Next up, add music driven by the neighbourhood (i.e. a different tune for each woeid, which means 26 different tunes for Vancouver).

Vancouver real-time flickr cloudmade html5 mashup:

Code:

github.com/rtanglao/rth5/blob/master/vancouver-emerges...

Try it out yourself! (may take some time for photos to appear since dots are only added when photos are uploaded to flickr geotagged in the city of vancouver):

dl.dropbox.com/u/361757/CCC/vancouver-emerges-d3.html

San Francisco real-time flickr cloudmade html5 mashup:

Code:

github.com/rtanglao/rth5/blob/master/sanfrancisco-emerges...

Try it out yourself (may take some time for photos to appear since dots are only added when photos are uploaded to flickr geotagged in the city of san francisco):

dl.dropbox.com/u/361757/CCC/sanfrancisco-emerges-d3.html

Das Blinkenlights w/CloudMade APIs of Vancouver & San Francisco real-time geotagged flickr photos: use map.removeOverlay()

Submitted by Roland on Fri, 2011-05-20 00:35

To the three :-) people in the world who care about blinking lights on a CloudMade Map : Evidently CloudMade and the web browsers can't handle  large amount of overlays i.e. 1000s of them :-). So the solution is to map.removeOverlay() before map.addOverlay(). If you don't remove the overlay before you addOverlay() then the browser slows down and leaks a large amount of memory.

I'll post a video later of the incredible Das Blinkenlights :-) but you can try it yourself. Just click on one of the following URLs to try it yourself (the map will be all black until somebody uploads some geotagged photos which could be anywhere from 1 second from now until an hour from now):

 

The Revolution is not YET geo-tagged camera blogged aka In search of Das Blinkenlights

Submitted by Roland on Wed, 2010-11-03 00:49

tl;dr: Surprised by the paucity of real-time geotagged photos on flickr. People seem to upload in batches many hours after the fact. Still looking for a cool real-time geotagged picture feed so I can do some Blinkenlights info visualizations in a web browser near you!

Real Time Average Colour of Geotagged photos of 18 cities after a few minutes

12:43am 27Oct2010 Snapshot of 18 Cities Real Time Average Color of Geotagged flickr

Real Time Average Colour Geotagged photos of 18 cities after a few hours

8:16am 27Oct2010 Snapshot of 18 Cities Real Time Average Color of Geotagged flickr

Since 2007, I have over 50000 21000 (29000 non geotagged) geotagged photos uploaded on flickr from cameras most in real-time or near real time (a few minutes to a few hours after they were taken). I expected in 2010 that there would be many real-time geo tagged obsessive :-) photo uploaders like me. Enough to power a cool Blinkenlights info visualization.

Well I was wrong :-) Based on the info viz (geoTaggedAvg18.html ; github source - tested Firefox 4, Chrome, iPhone 4, Android 2.1 - each dot is the average colour of a geotagged photo uploaded to 1 of 18 cities, there are 24 dots per row and then it wraps around after over 24) that I did in Javascript and HTML5 even in geo-tagging mad cities like New York and San Francisco and Vancouver, people don't upload geotagged photos in real-time to flickr (and I doubt elsewhere but love to be proven wrong, if anybody has a real-time updated photo stream with lat/long and an API that has more photos than flickr, please let me know:roland AT rolandtanglao.com twitter:@rtanglao). They do it after the fact and they don't do many.

Probably because:

  • people are concerned about loss of privacy
  • uploading with GPS coordinates is too hard
  • GPSes are unreliable but getting more reliable every day
  • most people upload to social media ghettos like Facebook and Twitpic where most of their metadata including latitude and longitude is lost and/or not available via API instead of "full photos as social object with full-meta-data-preservation-and-APIs-to-get-the-meta-data" services like flickr
Subscribe to RSS - flickr api