potomak / jquery-instagram

Instagram jQuery plugin
http://potomak.github.io/jquery-instagram/
MIT License
554 stars 143 forks source link

Additional condition: 'user_has_liked' #26

Closed meldraw closed 11 years ago

meldraw commented 11 years ago

Hi, I'm not an advanced JS coder, but trying to muddle through...

I'm looking for a way to "approve" the photos that appear in my gallery using this plugin. I thought perhaps I could do this by liking any hashtagged photos as a method of approval.

Is there a way to utilize this plug-in to return photos with both a hashtag AND a true "user_has_liked" key? I am using an oauth access token for the appropriate account, so I believe I have the user_has_liked key at my disposal (according to the Instagram API documentation). I just don't know how to write it into this javascript as a condition.

Thanks!

potomak commented 11 years ago

You can use the onComplete callback to filter results using the user_has_liked attribute, but with this plugin you can't include the user_has_liked as a search parameter.

meldraw commented 11 years ago

What is the best way to implement this using onComplete? Would you place it in the function code on the page, or would you place it in the JS file? Can you provide sample code for me?

I appreciate it, thanks!

potomak commented 11 years ago

Example: https://github.com/potomak/jquery-instagram#alternative-method