Discussion on api-documentation

0 views
Skip to first unread message

z19

unread,
Jun 7, 2008, 11:01:29 PM6/7/08
to ScrnShots Developer Talk
why URL with :: after http?

Greg Bell

unread,
Jun 7, 2008, 11:08:43 PM6/7/08
to ScrnShots Developer Talk
Hey thanks for that. It was just a typo. Should be fixed now.

On Jun 7, 8:01 pm, z19 <limea...@gmail.com> wrote:
> why URL with :: after http?

chriscoyier

unread,
Jun 19, 2008, 11:21:25 AM6/19/08
to ScrnShots Developer Talk
Is there a way to get a JSON response of all my recent screenshots?

Greg Bell

unread,
Jun 19, 2008, 11:29:17 AM6/19/08
to scrnshots-de...@googlegroups.com
Currently, you can get a JSON response on any of your screenshot pages
by using the following URLs:

http://www.scrnshots.com/users/{username}/screenshots.json
http://www.scrnshots.com/users/{username}/screenshots.json?page=2

This will return to you the most recent 20 screenshots for the user.
Currently, there is not way to change the sort order or the number of
items returned.

Greg Bell

\\ ScrnShots.com

chriscoyier

unread,
Jun 19, 2008, 11:51:05 AM6/19/08
to ScrnShots Developer Talk
Cool, thanks Greg, that seemed to work. I just need to learn more
about JSON I think. I'm trying to (just for fun), make a little "my
social stuff" page. I was able to pull in Twitter and Flickr via JSON
and I want to add ScrnShots to it, but it doesn't seem to work in
quite the same way.

All Three:
http://css-tricks.com/examples/BuildYourSocialPage/index.html

Just ScrnShots:
http://css-tricks.com/examples/BuildYourSocialPage/index2.html

Greg Bell

unread,
Jun 19, 2008, 11:51:52 AM6/19/08
to ScrnShots Developer Talk
Hey Chris, also just realized the the information provided in that
JSON object would not be very helpful. I am working on it right now
and should have an updated JSON object representation to match the XML
soon. I'll post when it is ready for you.

Greg

On Jun 19, 8:29 am, Greg Bell <gregdb...@gmail.com> wrote:
> Currently, you can get a JSON response on any of your screenshot pages  
> by using the following URLs:
>
> http://www.scrnshots.com/users/{username}/screenshots.jsonhttp://www.scrnshots.com/users/{username}/screenshots.json?page=2

Greg Bell

unread,
Jun 19, 2008, 12:24:58 PM6/19/08
to scrnshots-de...@googlegroups.com
Alright, you should have access to the proper objects now. When
calling the url I gave you earlier it should return a JSON object that
looks like this:

{
"images": {
"medium": "http://s3.amazonaws.com/scrnshots.com/screenshots/15714/SSFirefoxPluginPreview_med_rect.png
",
"small": "http://s3.amazonaws.com/scrnshots.com/screenshots/15714/SSFirefoxPluginPreview_small_square.png
",
"large": "http://s3.amazonaws.com/scrnshots.com/screenshots/15714/SSFirefoxPluginPreview_large.png
",
"fullsize": "http://s3.amazonaws.com/scrnshots.com/screenshots/15714/SSFirefoxPluginPreview.png
"
},
"description": "A little preview of what's to come for you firefox
users. ",
"comments_count": 4,
"url": "http://www.scrnshots.com/users/gregbell/screenshots/15714",
"created_at": "2008-06-19T00:28:22+00:00"
}

That means that if you stored the object in a variable called
screenshot, you could access the url for a thumbnail by using
screenshot.images.small

Let me know how things go!

Greg

Greg Bell

unread,
Jun 19, 2008, 1:15:04 PM6/19/08
to scrnshots-de...@googlegroups.com
Hey Chris, I had a look at your Social Page (cool idea!) and got the
code working for the ScrnShots section:

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$.getJSON("http://www.scrnshots.com/users/chriscoyier/screenshots.json?callback=
?", function(screenshots){
$.each(screenshots, function(index, screenshot){
$("#scrnshots").append("<a href='" + screenshot.url + "'><img
src='" + screenshot.images.small + "' /></a>");
});
});
});
</script>

This will append thumbnails to a div called scrnshots.

Greg

On 19-Jun-08, at 8:51 AM, chriscoyier wrote:

chriscoyier

unread,
Jun 19, 2008, 3:39:28 PM6/19/08
to ScrnShots Developer Talk
Brilliant Greg!

That's great that it's returning the full URL to the thumbnail
location and the ScrnShots page. Example page is up and working:

http://css-tricks.com/examples/BuildYourSocialPage/

Just need to style it up and then I'll write up a little tutorial on
how it's done =)

-Chris

Greg Bell

unread,
Jun 19, 2008, 3:48:38 PM6/19/08
to scrnshots-de...@googlegroups.com
Very cool. The only issue is that the Twitter JSON asks for my
username and password everytime. Otherwise looks like it'll be a cool
tutorial. Thanks for using ScrnShots in it!

Greg

chriscoyier

unread,
Jun 19, 2008, 4:05:35 PM6/19/08
to ScrnShots Developer Talk
Yeah the Twitter API requires authentication, which sucks. Shouldn't
ask every single time though, that's weird. I'm gonna try to hard-code
some authentication in (somehow), or just use a different part of
their API that doesn't require it (somehow) or... something... =)

Anyway, thanks for the help on this, very cool of ScrnShots to offer
up such a good API

Chris
Reply all
Reply to author
Forward
0 new messages