Author Topic: Catalog: online token reference  (Read 4099 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Catalog: online token reference
« on: November 06, 2012, 01:57:13 am »
If you've been on IRC lately, you may have noticed that my bot has a few new commands—:basic, :axe, and :grammer. Each command takes a calculator token (or part of one) as an argument and returns syntax and function information and the key presses used to get to that token, all in a format shamelessly ripped from Runer112's @z80 bot. (If you haven't seen it, you can try it out from OmnomIRC.)

You may also know this already, but the script is actually polling all its data from a new project of mine, called the Catalog. It's an online reference aiming to document all the functions and variables found on the TI-83 Plus series, in TI-BASIC, Axe, Grammer, and possibly other languages. You can access the full resource at http://clrhome.org/catalog/.

And following the massive un-success of the Wikipad project, I've also decided to make this a wiki. If you see an improvement you'd like to make in any section, you can double-click it to edit. (Changes are saved automatically.)

With help from Xeda, Sorunome, and others, all the TI-BASIC commands are documented. (Thanks to TI for letting me use their handbook descriptions! :D) The Axe and Grammer sections still need a lot of work though, so it'd be great if someone could do the work for me ;D

The API

Spoiler For Spoiler:
Another big change I'm putting in this time around is the public API. Any app that connects to the Internet can request all the token information from the Catalog for TI-BASIC, Axe, or Grammer (my IRC bot is an example).

The data can be requested either as XML or JSON:

http://clrhome.org/catalog/?alt=xml

http://clrhome.org/catalog/?alt=json

You can request a language other than BASIC:

http://clrhome.org/catalog/axe?alt=xml

http://clrhome.org/catalog/grammer/?alt=xml

You can request data for one specific token based on its table offset:

http://clrhome.org/catalog/199/?alt=xml

http://clrhome.org/catalog/187/15/?alt=xml

You can even have it pretty-printed:

http://clrhome.org/catalog/187/15/?alt=xml&prettyprint=true

I haven't documented the structure yet, but it should be fairly self-evident if you look at the prettyprint example. The JSON works the same way but with all attributes and child elements converted to object properties.

Hope you find it useful :)
« Last Edit: December 11, 2012, 07:28:11 pm by Deep Thought »




Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Catalog - online token reference
« Reply #1 on: November 06, 2012, 02:08:23 am »
I was going to suggest BBC Basic, but then I remembered it doesn't use tokens at all. First time that's been a bad thing :P

This looks useful!
« Last Edit: November 06, 2012, 02:08:38 am by willrandship »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Catalog - online token reference
« Reply #2 on: November 06, 2012, 03:30:38 am »
Very nice Deep! :D