Hi,
What am I doing wrong?
Ok, looking at
http://api.comicvine.com/volume/2294/?api_key=(API)&format=xml&field_list=issues
The very last issue in results is the first one on this page
http://www.comicvine.com/thor/49-2294/?sort=issue_number
Second last is second on same page
Third last is third and so forth
Which seems to me it's sorting by issue ID from Highest to Lowest, or most recent to least assuming the issues were added sequentially in a timely manner, so you only have to grab the first/last issue and check if the numbers match. Or check once very 25? issues. For Example
1
..
25 - do you have 25 entries and on issue 1 + 24? good
..
50 - do you have 50 entries and on issue 25 + 24? good
..
75 - do you have 75 entries and on issue 50 + 24? good
..
100 - do you have 100 entries and on issue 75 + 24 ? no, go back however many results you have ( you wont have 25 ) and check where it breaks down? ( check my algorithm, i scaped by in college )
I wish we could have sort=id and sort=!id or something for reverse lol but who am i to complain? this is my first api that i'm learning.
Let me know if this works out for you. I'd really like to know.
I just did! The trick proposed did not work... the ids are sequential according to the time the book was added not to the release date or the like. I finally decided to locally cache the pairs (id - issue) so, first time you need a long search, but after that i look up the cached table and it is fast. You can check the script at comicrack site!
Please Log In to post.
Log in to comment