sozin
I've created the skeleton of a python implementation of the obsidian portal API named "oppy".
Here's the github url: https://github.com/lhayhurst/oppy
As per the README, right now it is -very- simple: it comes with a bootstrapping program that will walk the user through the creation of their consumer key, consumer secret, oauth token, and oauth secret. The README describes how to download it, its dependencies, and run it to register your application on OP.
Stay tuned for code that actually does something with the API :-)
Comments
The easiest one is out- the user API. Usage is pretty trivial:
userApi = UserAPI( OpyConfig() ) #assumes that you've already bootstrapped your oauth key and tokens using bootstrap.py
userApi.fetch() #fetches the user info as per http://help.obsidianportal.com/kb/api/api-users
print userApi.username(); #prints your username
print userApi.campaigns(); #returns a list of campaigns
#etc
micah's graph: https://github.com/lhayhurst/oppy/blob/master/examples/micah.gif (click raw in github to see it full size)
https://github.com/lhayhurst/oppy/raw/master/examples/sozin.gif (sozin's graph)
src code: https://github.com/lhayhurst/oppy/blob/master/examples/graph.py
When I first started, I imagined Obsidian Portal as partly a social-network. Only after a while did I realize that the network was in fact a collection of isolated islands. Your "network" rarely extends past the group that you game with. It's not a bad thing, just different from other "friend-collector" social networks.
Cool tool :)
if I had all of the user ids (or user names), I could kick off a job to build the graph of the entire system. Would probably confirm the island effect. (as well as look neat.)
- Simple object oriented API
- Easy to use bootstrapping utility to set up your oauth consumer key, consumer secret, oauth token and oauth secret.
- Ability to fetch a campaign by campaign id or slug
- Ability to fetch a user by self, by id, or by username
- Ability to fetch all the characters for a given campaign, a character by id, or a character by slug
- Ability to fetch a wiki by campaign, by campaign/page id, and by campaign/page slug.
- Ability to fetch the campaign's adventure log.
- Fully integration tested
Note that there are two outstanding bugs, both seemingly on Obsidian Portal:
- Fetching a character by slug might return the wrong character, if there is another character with that slug
- Fetching a wiki page by slug returns the wrong page.
At this point oppy should be at feature parity with both mage-hand and sunrod. (Hey, Micah, any chance you can throw oppy up onto http://help.obsidianportal.com/kb/api/api-libraries?)
On the backlog:
- Ability to create and update a character
- Ability to create an update a wiki page
- Ability to get, show, update, and submit dynamic sheet templates.
Once these 3 features are done I'll have fully rounded out the public API.
--sozin
*gentle bump*
If it's not good enough to be "official", what needs to be done to make it good enough?
szoin: if you're not maintaining this anymore, are you open to handing it off to someone?
- I haven't changed the code in a long time
- w/respect to making it official, I don't know the answer to that one. I could be wrong, but it seems like OP management stopped paying attention to the API threads (like this one), and my gaming groups moved off of Obsidian Portal, so I stopped working on the code. my OP account has expired as well, so I can't run the unit tests, but if you have a current OP account you can try running all the unit tests to see if the back end server code still supports the same API that I coded against.
- I'd be happy to hand over ownership of the project! just let me know how you'd like to proceed and I'd be happy to help out.
cheers
Regarding ownership handover, I'd like to read through your code in depth before we actually think about doing that. If I'm happy with it, or i feel like it would save me a lot of time to refactor it into working, I figure you can just transfer ownership of the github repo to me. As long as there isn't anything else related to the project that would need to be handed off, that's probably all we'd need to do.
I'll try to get through the code today or tomorrow and let you know my thoughts then. if you'd prefer another method of communication about this, let me know - these forums probably aren't the best avenue available to us.
Thanks!