In anticipation of the contest to "Win an iPhone!" I thought it would be a good idea to add a "Top Projects" widget to allow us to see which projects are currently the most popular; think of it as the early poll results! :)
You can check it out here...
Curious how I created this widget? Well it really only took a few calls to our API...
1. Made a call to post.get to get all the active posts/projects in the "Gallery" category
2. Built an array of all the posts that are returned
3. Made a call to vote.getratingresults to get all the posts that had been recommended and ordered them in descending order
4. Made another call to vote.getratingresults to return and display the actual number of recommendations for each of the projects
That's it...it was pretty simple. If you want to get the exact code to duplicate this functionality, you can just look under the covers and grab it...I did it all with JavaScript.
If you have any questions let me know...
You can check it out here...
Curious how I created this widget? Well it really only took a few calls to our API...
1. Made a call to post.get to get all the active posts/projects in the "Gallery" category
2. Built an array of all the posts that are returned
3. Made a call to vote.getratingresults to get all the posts that had been recommended and ordered them in descending order
4. Made another call to vote.getratingresults to return and display the actual number of recommendations for each of the projects
That's it...it was pretty simple. If you want to get the exact code to duplicate this functionality, you can just look under the covers and grab it...I did it all with JavaScript.
If you have any questions let me know...
More »


Enlarge