#1 Posted by TWIXMIX (10 posts) -

Hi Everyone, 
 
I'm using the following api call to return videos, but it's not ordered the way I would like it to be: 
 
http://api.giantbomb.com/videos/?api_key=NoKeyForYou&sort=publish_date     
 
It's returning the XML fine, but it's ordered oldest to newest. Is there any way to return the videos from newest to oldest? 
 
Thanks

#2 Posted by LordAndrew (14417 posts) -

Sort doesn't work. It's not a thing you can do.

#3 Posted by TWIXMIX (10 posts) -

Darn. 
 
That's going to cause some issues with the App I want to make. I'd rather list the newest stuff first. 
 
Oh well... :(

#4 Posted by LordAndrew (14417 posts) -
@TWIXMIX: Do an initial request to get the number of results, then use that number to go to the last page and get the newest stuff from that page. You can work backwards from there, and it has the advantage of not duplicating items as videos are added to the site.
#5 Posted by TWIXMIX (10 posts) -
@LordAndrew: This is very true, I was thinking of doing that if it was required. Thanks for the heads up I'll give that a shot!
#6 Posted by TheFaxman (50 posts) -
@TWIXMIX: I got this to work by using a sort specifier of  "-publish_date".  The - seems to indicate a descending sort order
#7 Posted by TWIXMIX (10 posts) -
@TheFaxman: Hmm, everybody seems to think sort is broken but I'll give that a try when I get home. 
 
Thanks!
#8 Posted by TWIXMIX (10 posts) -
@TheFaxman: Awesome! It seems to work perfectly. Thanks again!