Discussion: Home streets

It's already in the feature request thread, but I think it deserves one of its own:

Why are home streets not available in locations.streetInfo?
Could we please please have access to them?
It's coming
www.glitch.com/status/PLI16...
Hopefully sooner than soon™
owmygowd towers are not even in the API already, let's complain ^^
locations.streetInfo will now work for home street and towers (for everyone) and house interiors (for owners only)
yeaa wow indeeed I just noticed!!! cool bees!

Most useful info would be neighbors links still, and I'm not seeing any "connections":{} :\
The tower works just fine, but I still get an error for my house
It's gonna be fun to showcase people tower images from the API now ^^

Lemo's House
Lemo's Home Street
Lemo's Tower
your house will only work if you're authenticated
Ow yeah, sure /dumb, was so used to have this call without auth

The point about neighbors is still valid though :]
Check again now for neighbours (and links between home/house/tower)

http://api.glitch.com/simple/locations.streetInfo?street_tsid=LHV7JINTAOV2CKV&pretty=1
Sweet!

Now that you're around...
wouldn't it be fun to have the note pole contents in there as well?
not sure about the actual uses of that yet, but it could be quite powerful, like tags or something for ex.
Hmmm. I wonder why we don't just return a list of all items in a location. Then i'd just need to add the note contents to the getInfo method for note poles.
You mean, like, Everything? the stuff on the ground and all that?
That'd be a lot of fun to play with for sure :p
In that case how about coins? ^^ (roobrik & balzare don't have much to tell to the API right now)
All items in a location sounds super! If that's not possible, it would be very helpful to return the presence of Machines, Icons, and Cultivation Projects. Thanks for the updates!
Alright, I'm pretty much a JSON newbie here, but in the idea of having a list of neighbors when you don't know each of their TSID yet, wouldn't it be more simple to have a simple array here, rather than a hierarchy with unknown variables? I mean, in that case why do we have the same TSID value in the child properties as well?

I'm thinking about:
Before
After

Or another example with the "results" listing here
is there any chance that locations.streetInfo of a Tower returns as features the SDB it has... with each one price? :)

TIA
Lemo: you don't have to know the keys to iterate over a hash/object. In JavaScript, just do this:

for (var tsid in ret.neighbors){
    console.log("neighor TSID is "+tsid);
    console.log("neighor name is "+ret.neighbors[tsid].name);
}
Thx Bees
Actually I'm making a Flash app, and I'm using this library to parse JSON
With the other calls I just had to use something simple like: o.hub.name
(would be like o.neighors[0].name and a loop here)
Will have a look how to translate your code to actionscript...
it will be the same in ActionScript...
for(tsid .... ret.neighbors) is returning... not the content of .neighbors[], but each "key" (in this case each neighbor tsid).
then for each key, you get the actual content of that element with ret.neighbors[tsid]
the reason is that instead of returning arrays Glitch always returns a hashmap, where each key is the tsid and the "value" is the object of that tsid.

what version of Flash are you using because AdobeFlash already comes with a JSON library. you just call "JSON.parse()" and that returns an object, in the Bees! example will be the "ret" object.
Yeah I'm using an Ancient flash version :p hence the custom lib
Had no idea these for-in loop thingies existed
Well it seems to work indeed, thx for the help!
I don't know if you are using the "design" part of Flash a lot, but IMO the best IDE for ActionScript is Intellij IDEA
www.jetbrains.com/idea/feat...

I think the free version supports it too. and Flex/ActionScript SDK is free. so you could use the latest version of ActionScript for free.

HTH
Okay I'll have a look!
But yeah I kinda like using the design part at the same time
Hmmm, tower name in the API currently simply returns "<player name>'s tower". Is there any way to get the actual name of the tower?
Oh, and the 'active_project' field doesn't actually work right now. I just tested it against a cultivation project on someone's home street.
we need a projects.searchActive(...) method!!

I think that the connections list needs a field location_type (tower, interior) (those two right now), but if there will be more, we need a way to know which one is each one, specially if the name is changed.
Also the hub.name is empty right now, maybe you could stick the type of the current street in there as well
The active_project field is for street projects, but it will always be false on home streets, towers etc since they aren't street projects.
And, uh, also, can we have some consistency in the "features" field please? If the street is uncultivated, the API returns an empty object, but if there is something on it, it returns an array with a single element, a  HTML string containing all the features. This doesn't make sense at all, especially considering in JavaScript, {} == true, which is rather annoying.
Planned additions:
* All items in location, with some details for certain item classes (SDB contents, note text, etc)
* Custom name for towers
* Street 'type' for interior/exterior/tower locations
* (Restoration) projects on interior/exterior/tower locations

The format of the `features` data should be ignored and will probably be removed from the API in favor of information about the actual items in the location. It's currently just the data the client uses for loading screens, which is why it has such a hard-to-parse format.

As many of you have figured out, the web site and game client both use the API (with hundreds of private methods) and cruft like this get exposed when we open up these API methods.