No support for other Stackexchange sites
There is no support for any of the other Stackexchange network sites.
How should this be added? Replicate the StackOverflow parts, just re-name it to the appropriate SE site name, or do something else? I'm open to working on this.
Hi, James. Sorry for the belayed answer.
I think it would be better to avoid duplication and reuse most parts of the gem, like the Client and the Base class. If we just rename the classes we'll have lots of duplication. What do you think of it?
I'm also open to other implementation strategies.
Well, maybe I'm thinking this through the wrong way.
Perhaps what it should be is you have the stackexchange class, and the
site class - have all API methods defined once in the stackexchange
class, and then have a master class that accepts different API
endpoints - so api.stackoverflow.com would work, as would
api.<new-stackexchange-site-that-isn't-in-existence-yet>.com, if
that makes sense.
I think that It makes sense. Can you build a prototype so that we can work on this together?
Not sure how I'd go about starting something like this - I'm fairly new to Ruby and programming in general. :P
If I understand this issue correctly, you're looking for a way to query other SE sites?
The default URL is set to http://api.stackoverflow.com but it's possible to change this in the config block, where you also set your API key.
StackExchange::StackOverflow::Client.config do |options|
options.url = 'http://api.gaming.stackexchange.com'
end
I guess the other issue here is how everything is nested underneath a module of StackOverflow, which is pretty confusing in itself as the gem isn't SO-specific. (Also, changing the targeted API URL should probably be in the readme)
I agree with you, @thomas-mcdonald. The Client class (and maybe some others) shouldn't be nested in the StackOverflow module. I haven't had the time to take a deep look into this issue yet, and I think that a good way to start the feature requested by @jrgifford would be to refactor the Client class to be more "site-agnostic". I also think that the remaining "model" classes should extend the same Base (also "site-agnostic") class.