Archive for the ‘Random Notes’ Category

Hey Flickr, Where Did My Statistics Go? OAuth, the Flickr API and You.   3 comments

In Yahoo’s misguided attempts to make Flickr a Phone photo sharing app like Instragram has radically redesigned the interfaces on both the desk top and on phones. Along the way they give you the option of uploading all of your phone photos directly to Flickr from your phone.  Which is nice, I guess, but Google and Microsoft and DropBox also offer the same service. I mean why would I want to dump my raw photos to Flickr when I, like most Flickr users, do our processing offline (in Photoshop for example) and post our best work to Flickr.  It would seem they are abandoning their core users (amateur photographers) to make way for the Instragram raw sewage stream of sunsets, meals and selfies.  Strange.  They are going to lose out to the Instragram / Facebook for that market and alienate the current group of core users. Is this what you want to see when you go to Flickr?  This:

selfie  Or this?  9475221248_2009bb3d34_o[1]

In order to accommodate the change Flickr, like all the big players offers a huge amount of cloud storage ‘for free’.  Something like two Gigabyte of photo storage.   Before the big changes at Flickr there was a special Flickr service “Flickr Pro” which for $29 a year got you, among other things, daily usage statistics (going back 30 days) of your photos.  Statistics were also available via the Flickr API (more on this in a moment). With the new Flickr statistics are gone and the Flickr API for statistics are also gone.

So I started digging into the existing, and still supported, Flickr API to see what was necessary to get usage statistics from Flickr for my photos using the Flickr APP.  I a C# programmer by profession so I started by looking at existing Flickr API libraries to leverage in this quest.  The godfather of C# Flickr API libraries is the FlickrNet API Library which is available in source under both the LGPL 2.1 license, and the Apache 2.0 license.

But First

This is a great and fully comprehensive library but to use it you need a couple of things to get started.  You must obtain a non-commercial personal API Key from Flickr (an application key). Apply for one here. But wait there is more.  Although the Flickr API is fairly straight forward you must, must, must, use Flickr’s implementation of OAuth with the application key to access Flickr data.  This post will be devoted to getting up and running with the Flickr API and Oauth.  Subsequent posts will discuss how to read photo view data and present a simple file database to store statistics.  Finally I will turn to using CouchDB and a Web front end to do the same work.  For this part we will switch over to Ruby and write our own simplified FLickrNet library.

OAuth

OAuth, in its many variations, is all over the place on the web these days.  Every time you see a “Sign In with…” Facebook, Google, whatever you are using OAuth in action.  You must use the Flickr OAuth implementation  to access your own data on Flickr.  It is really not all that hard although at first blush it looks impossible.  Here is Flickr’s own overview:

Simple and fun you say!

32607_alice_madness_returns

It’s not that bad when you get into it.

Using code samples provided by the folks at FlickrNet here is a simple walk through of how to setup OAuth to access your own data for a desktop application.  First we will look at it as a simple cook book approach (in C#) and then give a much simpler view of OAuth than the above diagram.  And that will be it for this post.

  • Application Key

Get an application Key and a “shared” secret from Flickr (start here).

  • Grant Access Writes for this Application Key

Get the user (that’s you to grant you access to their (your) photos.

Prepare a special HTTP  Request to Yahoo which looks like

http://www.flickr.com/services/oauth/authorize?oauth_token={hash}&perms={permsValue}

where:

{permsValue} is the access writes you are requesting to have granted to the caller

{hash} is a   Base64 encoded SHA-1 hash based on your Application Key and shared secret.  Not to worry FlickrNet handles the details for you.

Assuming you have created a FlickrManager class object (following the examples in the FlickrNet Samples Site) which includes your Application Key and shared secret the request URL is created as:

Flickr f = FlickrManager.GetInstance();  //you create this and encode your Application Key and Shared Secret into this class

requestToken = f.OAuthGetRequestToken(“oob”); //”oob” indicates that you are making a desktop request not a request from a web page

string url = f.OAuthCalculateAuthorizationUrl(requestToken.Token, AuthLevel.Read);//Request access to only what you need, in this case READ

opening this url will direct you the Yahoo login page and once logged in ask if you which to grant access for this application key to your data (photos and stuff) on Flickr.  When you answer YES Flickr will present to you on the screen (no call back as requested) an grant access key which is unique to your data and your application key.  This key is also called the“verifier” Write this down, we will use it below.

Here is what is happening in principle.  Flickr and you as the developer have a trust relationship where they grant you and application key for your use as a non-commercial developer.  The shared secret  is used as a key to encrypt messages between you (the developer) and Flickr.  This is used to request an access grant key between this application key (as a developer) and your data (as a Flickr user).  This is a one time process.

Get The OAuth Token

Each time we want to get  data back from Flickr we need to combine our Application Key, Shared secret and the access grant into a second specialized URL Get request to receive an OAUTH token which is time limited. In simple FlickrNet Code this looks like:

Flickr f = FlickrManager.GetInstance();
var accessToken = f.OAuthGetAccessToken(requestToken, verifier);
FlickrManager.OAuthToken = accessToken;

Here requestToken is a class object containing the Application Key and shared secret.  The field verifier contains the Grant Access Key we obtained above. The call to OAuthGetAccessToken builds a HTTP Get request to:

https://www.flickr.com/services/oauth/request_token?oauth_signiature={sig}

where:

seg is a SHA-1 Hash of the input parameters. Let FlickrNet handle the details for you.

Ok So Far? Here is a picture:

Picture1

 

Each data call to Flickr for data is an HTTP call and should be signed with the Application Key and the Access Object Token. Responses are returned in any of several formats of which XML and JSON are the most important.  Here is what a simple call to get photo data for a specific user (and returning XML) looks like:

https://api.flickr.com/services/rest/?method=flickr.people.getPhotos&api_key=123456789&user_id=12345&format=rest&auth_token=12345-6789&api_sig=98765

where:

api_sig is a hash of this call based on our Token Secret.  Not to worry we will use the FlickrNet assembly to generate this value.

Ok.  That’s enough for one post.  Get your Application Key from Flickr, Run the samples for FlickrNet to get your access key and generate an Access Object (OAuth Token), and in the next post we will dig in with using the Flickr API.

 

Part 2 continues here.

 

 

 

 

 

Posted 2014/07/03 by Cloud2013 in Flickr, Photography, Random Notes

Tagged with , ,

QR Codes, Bank Notes and the Great Wall of China   Leave a comment

Centuries of invaders couldn’t break the Great Wall of China, but a Chinese yuan can. Well, the “Great Firewall,” at least.

A series of one yuan banknotes became a whole lot more valuable after being stamped with a quick response (QR) code — a type of matrix barcode that, when scanned by a smartphone, sends a user to a website stored in the code — that circumvents the infamous firewall.

Beneath the stamped QR codes are the words: “Scan and download software to break the Internet firewall.” Doing so leads to an Amazon cloud link that hosts downloadable software to get around the firewall.

Read the rest of the story here http://mashable.com/2014/01/24/chinese-money-firewall/.

image

Posted 2014/02/13 by Cloud2013 in Random Notes

Watch “Chick fil-A vs. the Gays” on YouTube   Leave a comment

We Love Susie Sampson’s Tea Party Report

Posted 2012/08/05 by Cloud2013 in Infinite Jest, OWS, Random Notes

Tagged with ,

The Street Spirit–An American Friends Service Committee On Line Publication   Leave a comment

Banner1

As a long time attendee at the Portland, Maine Quaker meeting  I regularly follow various Friends oriented publications whether on paper or on online.  Reader of this blog will know also that I also use this blog to high light Occupy Wall Street related online publications.  I have been following Street Spirit online for some time now.  Street Spirit is a voice for peace and sanity in an often incoherent world.  Please visit this online publication for information on Justice, Homelessness and Occupy Everywhere Information.  In addition this is visually beautiful  featuring some of the nicest Occupy Everywhere poster art.

Pyramid   ForecloseEarth

Poster art by Vaughn Warren              Poster art by Dignidad Rebelde       Poster art by Celia Schorr and Susan Picatti

TOPteach

The Grateful Dead – The 1975 Tapes On The Internet Archive   Leave a comment

  • Grateful Dead Members During the  1970’s
  • Jerry Garcia
  • Bob Weir
  • Phil Lesh
  • Bill Kreutzmann
  • Ron “Pigpen” McKernan  (Left in June, 1972)
  • Mickey Hart  (Left in Febuary, 1971  and rejoins in October 1974 for the duration)
  • Keith Godchaux  (Joins In October, 1972 and left in Febuary, 1979)
  • Donna Godchaux – (Joins In March 1972 and left in Febuary, 1979)
  • Brent Mydland (Joins in April 1979 and left in July 1990)

The Grateful Dead In The 1970 – From The Hippie Cowboys of 1970 to the Jazz Age

While the core Grateful Dead members (Garcia, Weir, Lesh & Kreutzmann) remain members through out the 1970’s there were several changes in the band line up during this time.  PigPen left the band in ill health in 1972. Keith Godchaux joined that same year on key boards (primarily on a concert Grand piano but also on a Hammond B3 organ).  His wife Donna joined as a vocalist that same year.  Both of the Gordchaux’s left the band in Febuary, 1979.   Brent Mydland joined the band as a key board player and vocalist in April 1979).  Micky Hart (whose father controversially manager the band for a while) left the band under a cloud in 1971 but later rejoined in 1974.  This decade began with  signature songs such as Truckin’, Me & My Uncle and Jack Straw.  The Grateful Dead Movie (1972) solidified the band’s image in the public mind.  Later in the decade the band sound changed considerably.  The massive Scarlet Begonias –> Fire On The Mountain –> Estimated Prophet was perfected on stage and redefined the band.  The colorful marital discord and unhealthy lifestyle choices of the Godchaux (and Jerry and Bob’s search for a different (more electric and funk oriented) keyboard sound lead to the Godchaux leaving the band and Brent Mydland  joining the band in 1979.

In This Series:

____ 1970 1980 1990
____ 1971 1981 1991
____ 1972 1982 1992
____ 1973 1983 1993
____ 1974 1984 1994
____ 1975 1985 1995
1966 1976 1986 ____
1967 1977 1987 ____
1968 1978 1988 ____
1969 1979 1989 ____

Additional details of the Internet Archive Collection and how these lists were generated can be found here.

My blogs on individual Grateful Dead show can be found here.

A list of all soundboard tapes of Dark Star performances on the Internet Archive can be found here.

A list of all soundboard tapes of Scarlet Begonia -> Fire On The Mountain performances on the Internet Archive can be found here.

1975-02-28 – Bob Weir’s Studio Listen

1975-03-00 – Studio Listen

1975-03-17 – Ace’s (SNACK Rehearsal) Listen

1975-03-21 – Ace’s studio Listen

1975-03-23 – Kezar Stadium Listen

1975-03-26 – Ace’s Studio Listen

1975-04-02 – Ace’s Studio Listen

1975-04-17 – Ace’s Studio Listen

1975-06-05 – Club Front Listen

1975-06-07 – Bob Weir’s Studio Listen

1975-06-17 – Winterland Arena Listen

1975-07-07 – Ace’s Studio Listen

1975-08-13 – Great American Music Hall Listen

1975-09-28 – Lindley Meadows, Golden Gate Park Listen

The Grateful Dead – The 1973 Tapes On The Internet Archive   Leave a comment

The Grateful Dead Concert Tapes On The Internet Archive

The Internet Archive’s Grateful Dead is a great collection of concert tapes. There are over 2,000 unique concerts. There are multiple recordings of most concerts. This series attempts to provide a simple interface to this collection by selecting one recording for each concert on a given date. Preference is given to tapes processed by the great Charlie Miller and sound board tapes. Not all shows are well recorded but the there are great moments here. Dig in and enjoy! You didn’t have to be there. Good Luck.

  • Grateful Dead Members During the  1970’s
  • Jerry Garcia
  • Bob Weir
  • Phil Lesh
  • Bill Kreutzmann
  • Ron “Pigpen” McKernan  (Left in June, 1972)
  • Mickey Hart  (Left in Febuary, 1971  and rejoins in October 1974 for the duration)
  • Keith Godchaux  (Joins In October, 1972 and left in Febuary, 1979)
  • Donna Godchaux – (Joins In March 1972 and left in Febuary, 1979)
  • Brent Mydland (Joins in April 1979 and left in July 1990)

The Grateful Dead In The 1970 – From The Hippie Cowboys of 1970 to the Jazz Age

While the core Grateful Dead members (Garcia, Weir, Lesh & Kreutzmann) remain members through out the 1970’s there were several changes in the band line up during this time.  PigPen left the band in ill health in 1972. Keith Godchaux joined that same year on key boards (primarily on a concert Grand piano but also on a Hammond B3 organ).  His wife Donna joined as a vocalist that same year.  Both of the Gordchaux’s left the band in Febuary, 1979.   Brent Mydland joined the band as a key board player and vocalist in April 1979).  Micky Hart (whose father controversially manager the band for a while) left the band under a cloud in 1971 but later rejoined in 1974.  This decade began with  signature songs such as Truckin’, Me & My Uncle and Jack Straw.  The Grateful Dead Movie (1972) solidified the band’s image in the public mind.  Later in the decade the band sound changed considerably.  The massive Scarlet Begonias –> Fire On The Mountain –> Estimated Prophet was perfected on stage and redefined the band.  The colorful marital discord and unhealthy lifestyle choices of the Godchaux (and Jerry and Bob’s search for a different (more electric and funk oriented) keyboard sound lead to the Godchaux leaving the band and Brent Mydland  joining the band in 1979.

In This Series:

____ 1970 1980 1990
____ 1971 1981 1991
____ 1972 1982 1992
____ 1973 1983 1993
____ 1974 1984 1994
____ 1975 1985 1995
1966 1976 1986 ____
1967 1977 1987 ____
1968 1978 1988 ____
1969 1979 1989 ____

Additional details of the Internet Archive Collection and how these lists were generated can be found here.

My blogs on individual Grateful Dead show can be found here.

A list of all soundboard tapes of Dark Star performances on the Internet Archive can be found here.

A list of all soundboard tapes of Scarlet Begonia -> Fire On The Mountain performances on the Internet Archive can be found here.

1973-00-00 – Wake Of The Flood Sessions Listen

1973-02-09 – Roscoe Maples Pavilion – Stanford University Listen

1973-02-15 – Dane County Coliseum Listen

1973-02-17 – St. Paul Auditorium Listen

1973-02-19 – International Amphitheatre Listen

1973-02-21 – Assembly Hall, University Of Illinois Listen

1973-02-22 – Assembly Hall, University Of Illinois Listen

1973-02-24 – University of Iowa Listen

1973-02-26 – Pershing Municipal Auditorium Listen

1973-02-28 – Salt Palace Listen

1973-03-15 – Nassau Coliseum Listen

1973-03-16 – Nassau Veterans Memorial Coliseum Listen

1973-03-19 – Nassau Veterans Memorial Coliseum Listen

1973-03-21 – Utica Memorial Auditorium Listen

1973-03-22 – Utica Memorial Auditorium Listen

1973-03-24 – The Spectrum Listen

1973-03-26 – Baltimore Civic Center Listen

1973-03-28 – Springfield Civic Center Arena Listen

1973-03-30 – Rochester Community War Memorial Listen

1973-03-31 – War Memorial Listen

1973-04-02 – Boston Garden Listen

1973-05-13 – Iowa State Fairgrounds Listen

1973-05-20 – Campus Stadium – University Of California Listen

1973-05-26 – Kezar Stadium Listen

1973-06-09 – RFK Stadium Listen

1973-06-10 – RFK Stadium Listen

1973-06-22 – P.N.E. Coliseum Listen

1973-06-24 – Memorial Coliseum Listen

1973-06-26 – Seattle Center Arena Listen

1973-06-29 – Universal Amphitheatre Listen

1973-06-30 – Universal Amphitheatre Listen

1973-07-01 – Universal Amphitheatre Listen

1973-07-27 – Grand Prix Racecourse Listen

1973-07-28 – Grand Prix Racecourse Listen

1973-07-31 – Roosevelt Stadium Listen

1973-08-01 – Roosevelt Stadium Listen

1973-09-07 – Nassau Veterans Memorial Coliseum Listen

1973-09-08 – Nassau Veterans Memorial Coliseum Listen

1973-09-11 – The William and Mary College Hall Listen

1973-09-12 – William And Mary Hall – College Of William And Mary Listen

1973-09-15 – Providence Civic Center Listen

1973-09-17 – Onondaga County War Memorial Listen

1973-09-20 – The Spectrum Listen

1973-09-21 – The Spectrum Listen

1973-09-24 – Pittsburgh Civic Arena Listen

1973-09-26 – War Memorial Listen

1973-10-19 – Oklahoma City Fairgrounds Arena Listen

1973-10-21 – Omaha Civic Auditorium Listen

1973-10-23 – Metropolitan Sports Center Listen

1973-10-25 – Dane County Coliseum Listen

1973-10-27 – Indianapolis State Fair Coliseum Listen

1973-10-29 – Kiel Auditorium Listen

1973-10-30 – Kiel Auditorium Listen

1973-11-01 – McGaw Memorial Hall – Northwestern University Listen

1973-11-09 – Winterland Arena Listen

1973-11-10 – Winterland Arena Listen

1973-11-11 – Winterland Arena Listen

1973-11-14 – San Diego International Sports Arena Listen

1973-11-17 – Pauley Pavilion – University of California Listen

1973-11-20 – Denver Coliseum Listen

1973-11-21 – Denver Coliseum Listen

1973-11-23 – County Coliseum Listen

1973-11-25 – Feyline Field Listen

1973-11-28 – Palace of Fine Arts Listen

1973-11-30 – Boston Music Hall Listen

1973-12-01 – Music Hall Listen

1973-12-02 – Boston Music Hall Listen

1973-12-04 – Cincinnati Gardens Listen

1973-12-06 – Public Hall Listen

1973-12-08 – Cameron Indoor Stadium, Duke U Listen

1973-12-10 – Charlotte Coliseum Listen

1973-12-12 – The Omni Listen

1973-12-18 – Curtis Hixon Convention Hall Listen

1973-12-19 – Curtis Hixon Convention Hall Listen

The American Ayatollahs: Santorum and Franklin Graham   Leave a comment

In an amazing bigoted interview the son of Billy Graham questioned the Christian faiths of both President Obama (as a ‘son of Islam’) and Presidential candidate Mitt Romney.  A partial transcript is available here. Here is the full video:

Rick Santorum meanwhile questions President Obama’s ‘phony theology’ and tells us that a liberal christian is not a christian at all.  Further commentary here.  According to the Huffington Post:

When asked if he believed Obama is a “sincere liberal Christian,” the former Pennsylvania senator said he didn’t believe that sort of ideology exists, and that Obama’s church, United Church of Christ in Chicago, had “abandoned Christendom” and used a non-literal interpretation of the Bible.

“I don’t think there is such a thing,” he said of Obama as a liberal Christian. “To take what is plainly written and say that ‘I don’t agree with that, therefore I don’t have to pay attention to it,’ means you’re not what you say you are. You’re a liberal something, but you’re not a Christian.”

Santorum made headlines last week after telling an Ohio crowd that Obama subscribes to “some phony theology, not a theology based on the Bible.”

Here is a video of Rick trying to back track out of those statements

%d bloggers like this: