Posted by & filed under API, Python, YouTube.

http(s)://i(1-4).ytimg.com/i/(user_id)/1.jpg

For example, my YouTube channel (himself0890) User ID is: zRJMLe36PT0Q2mhlmbU2OQ

So, my avatar url could be: https://i3.ytimg.com/i/zRJMLe36PT0Q2mhlmbU2OQ/1.jpg or it could be https://i2.ytimg.com/i/zRJMLe36PT0Q2mhlmbU2OQ/1.jpg

I had the issue in Python when retrieving the User ID from the newsubscriptionvideos feed…

Read more »

Posted by & filed under API, MailChimp, Python.

Was searching around for a nice MailChimp API library and came across MailSnake

I was looking to catch exceptions so I decided to fork it. I submitted a pull request, but it appeared that Leftium abandoned the library. I reached out to him on Facebook and Twitter, but to no avail.

I decided to take it upon myself to maintain this repo, please follow the MailSnake repo at https://github.com/michaelhelmick/python-mailsnake

Posted by & filed under API, LinkedIn, Python.

Well, in my spur of writing nice, simple libraries to interface Python, OAuth, and a REST API from a certain service. LinkedIn was my last that I tackled. Not to say that there won’t be more to come… ;)

I had to think of a name other than ‘python-linkedin’ because it was already taken, so just “linkedin” seem to be fine. :)

This library interfaces LinkedIn JSON responses from the REST API with Python.

https://github.com/michaelhelmick/linkedin

Docs & download info can be found there.

Posted by & filed under API, Netflix, Python.

I was helping build a Netflix application and decided to write a clean library to handle Netflix Rest API with JSON responses.
Post these libraries on my blog are easier to find on google, so hope you enjoy another Python library. :)

https://github.com/michaelhelmick/python-netflix

Docs & download info can be found there.

Posted by & filed under API, Python.

I wanted to post an image to a Flickr Python library I’m writing, but was unable to find ANYthing on the web about posting an image via the Python OAuth library. @ryanmcgrath had the base of how to upload an image in his Twython library, but it wasn’t quite right because there were no oauth params being sent to Twitter. So, I finally cracked the case and made a breakthrough. Here you go, folks.

Posted by & filed under API, Javascript.

I figured I’d make a quick post about a problem I had while working with Google Maps API; this problem came up when I needed a DOM element to trigger a click on a Marker so an InfoBubble came up (http://blog.michaelhelmick.com/2011/04/23/google-maps-api-multiple-markers-multiple-infowindowsinfobubbles/)

The Problem

I needed to trigger a ‘click’ on a certain marker when I clicked a DOM Element. And you can’t just do markerInstance.click();

The Solution

To force the click, you need to call google.maps.event.trigger which takes two params (instance, event)
So, in our code, when anything with the class ‘forceMarkerClick’ is clicked, it calls that event and uses the item in our markerArray with the index that is available on the anchors data-markerId attribute as the instance and ‘click’ as the event.

For more information about google.maps.event.trigger, please view the Google Maps API documentation on it:
http://code.google.com/apis/maps/documentation/javascript/reference.html#event

Hope this helps!

Posted by & filed under API, Javascript.

I am currently working on a project that is dealing with using the Google Maps API. For a page of the website, it required that we grab the 10 nearest locations and put some markers on the map for those locations.

So, say I got back 10 locations, I would loop through the results and place the markers on the map. Google Maps InfoWindow wasn’t quite what I needed, so I worked with a library called InfoBubble:

http://code.google.com/p/google-maps-utility-library-v3/source/checkout

The Problem:

While looping through markers and trying to add a click event to each marker to pop up a InfoWindow or InfoBubble:
The click event was always binded to the last marker.

The Solution:

After googling for a while, I FINALLY came across a solution provided by @colinwiseman on his blog at: http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/

The variable marker inside where we are trying to set the click event was changed to this along with the contentString variable was changed to an attribute on marker called html. Best said by @colinwiseman: “as you were calling infowindow.open(map, marker) javascript engine’s memory location thingymabob (not good with names) held the last reference to marker”.

This is basically just a re-blog of his post, but in regards to using InfoBubble.

Again, thanks to Colin and his post on his blog at http://you.arenot.me

Posted by & filed under API, Freshbooks, PHP.

So, I came across a project for work where I had to work with the Freshbooks API. Instead of having users put in their “API URL” and “Authentication Token” everytime (by going to their Freshbooks > My Account > Freshbooks API), which was just inconvenient. I registered my app for Freshbooks OAuth use. Problem was, there wasn’t an great documentation on how to implement Freshbooks and OAuth calls. I tried authenticating with OAuth classes that were already built, but the problem was that Freshbooks expects an Authorization header and not Authorization posted to the body, as far as I could see. So, I read a blog entry on Formstack’s blog and started writing a Freshbooks API with OAuth class. I was able to get Authentication working and grab an access token, etc. but a problem lied where I couldn’t figure out how to send requests to Freshbooks API with an OAuth header. I contacted Michael Mattax ( @mmattax ) via email and he helped me out a little with a cURL function to send requests to Freshbooks API.

So, first off, after expanding the file available for download you’ll see and “index.php” and a folder “src” which contains: “freshbooks.php” and “config.php”.

** Updated October 1st, 2010

Read more »