|
|
I have a utility that makes it easy for users to add scripts to sites, and I'd like to integrate userscripts' listings within my utility; is there some sort of API where we can pull this list of scripts off the site? |
|
|
We have a partial API, but it's more or less what you get out of the box with Rails, so it's not as good as it should be yet, and it's still subject to change (i.e. your code might break if you use the API and we later change something). That said, try adding To simplify some code I wrote against the API, I've added some magic so that You can poke around in my Greasemonkey bundle for TextMate for some Ruby code (using curl) that uploads a script to this site automatically. Hope that helps. |
|
|
Does the site have (will have?) anything like categories or similar for the scripts? |
|
|
Seb: Yes, we certainly want something like that. Not sure if that'll be tags or some sort of site categories or both or something else. It'd be interesting to hear opinions on this, though it should probably be in a new thread. |
|
|
Someone recently posted a comment on one of my scripts telling me that it doesn't work any more since |
|
|
I have no clue that people still used me - I'll re-add that |
|
|
Excellent, thanks Jesse. I remember thinking it was pretty nifty when Henrik made the above post, so I put it in my favourites script. It seemed to be the easiest way of adding a link in my favourites script rather than adding extra code to find out an actual link for the user page. |
|
|
Jesse, any news on that promised US.o API? ;-) |
|
|
The first stab has started... http://userscripts.org/api - which documents a single call for Steve (of greasefire). Let me know what needs added.... |
|
|
Kewl!!! Nice job Jesse... will examine it further after I get back from a gig. :) Just a quick note before I'm off... you are inserting a \n in multiple places where they shouldn't be... and could you explain your Date/Time stamp please. 2005-06-19T23:33:49Z Thanks
|
|
|
The enters are odd - it will be fixed in tomorrows release. Regarding the times, it is XML Schema Date/Time {Date}T{Time}-{UTC offset} |
|
|
Ok, I would like it to get a list of scripts (with basic script data) by author id and to get script data (extended data: name, description, reviews, fans, comments, installs, etc...) by script id. Thanks for your work on the site :-) |
|
|
Mindeye wrote:You could go vote for it at http://userscripts.uservoice.com/pages/general/suggestions/144246 and add any additional information you think should be returned by the meta.js routine. And confirm that your vote(s) got counted... a friend of mine told me it's not always incrementing the vote count. |
|
|
Jesse Andrews wrote:Looks great! :) and thanks for the reminder on the TZ... I deal with so many different languages... sometimes things get lost in recall. Might want to put a note on the http://userscripts.org/api page that unlisted scripts don't show up (which is good of course) And how about publishing your spec of meta.js too ;) It's here and here too but would be helpful to have it here on uso in your styling. Thanks. |
|
|
I updated the scripts API to allow: filtering by user_id and including unlisted scripts as well. |
|
|
|
|
|
@Jesse
|
|
|
Yep.. I'm doing it one step at a time. It is v0 for a reason :) |
|
|
sizzlemctwizzle wrote:That is a matter of preference in my book... I prefer to use XML over JSON. So maybe Jesse could put a query parameter on which type to return and a default to one or the other. ;) *GRIN* |
|
|
change .xml to .js and you should get back json. There is a cursor object and scripts object. Please don't hit this automatically from userscripts yet as there isn't any caching in place. |
|
|
Jesse Andrews wrote: ooo thanks! Jesse Andrews wrote: Okay, I'll restrain myself for the time being. Marti wrote: I hate using the DOMParser. I'm fine using XML in other languages though, but JSON is just so much cleaner. |
|
|
sizzlemctwizzle wrote:LOL They are about equal on construction and cleanliness although appears the uso file sizes are larger with JSON. If you don't like DOMParser, I'm sure you won't be liking the JSON parser either ;) Anywhoo.. nice job, yet again, Jesse. :) |
|
|
I'm probably asking for it to be abused before I have protections in place, but if you do scripts.js?callback=foo it will return a JSON-P: foo({object}) |