TC01 / calcpkg

calcpkg is a command line tool for downloading TI calculator software from www.ticalc.org
MIT License
6 stars 1 forks source link

TI-Planet support! #9

Open TC01 opened 10 years ago

TC01 commented 10 years ago

As suggested by @debrouxl; we really should support TI-Planet as well.

Leaving a bug to remind myself about this.

adriweb commented 10 years ago

Since TI-Planet has an API for listing/searching, getting info, etc., supporting its archives will probably be much easier than the current other repos that don't. No HTML parsing is obviously better and future-proof :)

The API documentation is here : https://github.com/TI-Planet/API/blob/master/Documentation.pdf?raw=true Let me know if you have any questions/issues/whatever about the API.

I've created an API key for you, which is... the name of this repo followed by the number 42. (not very original, I know). Please don't include it in raw text, though (I guess you could import it from a file that would be in the .gitignore)

(BTW : please see #19 before releasing a version supporting TI-Planet archives)

Eeems commented 10 years ago

cough Omnimaga has a json API for this as well (Not the searching yet, it wasn't requested) cough

The issue I see with him having to have an API key that he can't include in the repo is that this is suppose to work out of the box for users, they can't use the TI-Planet archives if they don't get an API key for themselves.

adriweb commented 10 years ago

That's why I said "easier than the current other repos that don't." ;) (So that's particularly ticalc and Cemetech.)

For the API key, yeah, I know - if it's too annoying, we might as well forget about the need of an API key, we'll see.

TC01 commented 10 years ago

@adriweb: The API will be useful for retrieving file info (and of course #19 will get implemented then), but for searching...

If I pass no other parameters to the search API, will it give me a list of all files available? If so, then I will probably just write file/name indices to disk like ticalc, Cemetech, and Omnimaga. I really don't feel like making TI-Planet a special case in this regard (and I think it's better for a list of all files to be stored locally anyway).

As for an API key, I'd... prefer not to use one, if only because I tend to develop from a large variety of different machines and carrying around files not in version control will be problematic, especially when it comes time to release. Also because of what Eeems said.

But, I'm willing to use one if that's the way you want to do it.

adriweb commented 10 years ago

For listing all public uploads (that means, not the files made with our generators, as well as not the unlisted&private files), I added the 'list' request type. (so : /api.php?req=list ). Note that it will give the archive's ID, name, and primary category only.

(BTW, for searching, I added filtering by category. That's with &req=search&category=xxx)

For the API key, oh well, let's just not worry too much for now, we'll see how much it will be used. Go ahead and leave it in the repo (encode it in base64 then decode it ? :P), so that it will work for anyone when they checkout or fork the code (and still allow us (TI-Planet) to check who / what program uses the API). If it's abused, we'll act accordingly. If not, well it's all good.

adriweb commented 9 years ago

Bump.

I've updated our API to version 2.0 as per these changes:

Before / After: Difference v1/v2