Data feed suggestions

Started by Keen, February 09, 2011, 11:05:40 AM

Keen

Hello all,

I've been using Sentinel this month and liking it so far, mostly because it's lightweight and do not impact my game experience (unlike HeroStats).

One of the features I like most is the character feed. I have a personal blog where I have a Javascript snippet with my character data, updating it manually after every game session. I figured I could use CIT's feed for this, but there are a few things that keep me from it:


  • The data is shown "as is", meaning you can not just insert it in your page using a <script> tag. Including it via Ajax is not possible due to the "same domain policy" on Ajax requests. The only way to add it to your page is to use a server-side language (such as PHP) as a proxy, since the same-domain policy does not apply to them.
  • The character list on the page can be sorted, but that sorting is not applied to the feed.
  • Alignment tracking is not complete yet, it only tracks "Hero" and "Villain", and I have all alignments (including Praetorian ones) listed in my snippet.

For the first item, I suggest a way to convert the JSON feed into a script, not just raw data. Also, it could be a different option, because the raw JSON feed is still useful. Maybe call it "Javascript feed" or something. Currently, the raw "JSON feed" is like this:

[{"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...}]

The new "Javascript feed" could be something like this:

var CIT_DATA = [{"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...}];

The difference would be that the data is stored inside a variable, which makes the variable available in your page when you do the following:

<script type="text/javascript" src="http://cit.cohtitan.com/js/priv/123abc"/>

If you do the above with the current JSON feed, the data isn't stored anywhere and you can't use it.

The character sorting feature is very useful to me. I have several level 50's and there's no way to sort them "the way I want" using the character variables. Having it applied on the feed as well would save me the trouble of creating client-side scripts for sorting.

Last but not least, complete Alignment tracking, which I believe is already in the works. Hopefully.

That's about it. Thanks for listening and keep up the good work :)

Not a native English speaker.
But I'll let you point and laugh at my typos so I can fix them. :)

Aggelakis

Quote from: Keen on February 09, 2011, 11:05:40 AM
[other stuff]
I have no idea!

QuoteLast but not least, complete Alignment tracking, which I believe is already in the works. Hopefully.
I do know this one: Yes, the Titan team is hard at work overhauling CIT to be updated for GR/I19.
Bob Dole!! Bob Dole. Bob Dole! Bob Dole. Bob Dole. Bob Dole... Bob Dole... Bob... Dole...... Bob...


ParagonWiki
OuroPortal

Diellan

Quote from: Keen on February 09, 2011, 11:05:40 AM
For the first item, I suggest a way to convert the JSON feed into a script, not just raw data. Also, it could be a different option, because the raw JSON feed is still useful. Maybe call it "Javascript feed" or something. Currently, the raw "JSON feed" is like this:

[{"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...}]

The new "Javascript feed" could be something like this:

var CIT_DATA = [{"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...}];

Actually, the correct way to do this would be via JSONP, not via a variable. So you'd make the call as http://cit.cohtitan.com/js/priv/123abc?callback=functionName and you'd receive the a response of
functionName({"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...});

Keen

Quote from: Diellan on February 09, 2011, 11:42:15 AM
Actually, the correct way to do this would be via JSONP, not via a variable. So you'd make the call as http://cit.cohtitan.com/js/priv/123abc?callback=functionName and you'd receive the a response of
functionName({"char_id":"123","name":"Keen Stronghold","status":"Offline",...}, {...}, ..., {...});

That's certainly a much cleaner solution. :)

But it's currently unsupported by the JSON feed, right? I tested it with a working feed and the output didn't change.

Not a native English speaker.
But I'll let you point and laugh at my typos so I can fix them. :)

Sekoia

JSONP is currently unsupported, but I'll add it to the list of things to look into. CIT has lots of work pending so I can't say when we'll get to it.

Sekoia

Turned out JSONP was pretty easy to implement. The method for calling it is slightly different than described above, though. Instead of http://cit.cohtitan.com/json/priv/123abc?callback=functionName, use http://cit.cohtitan.com/json/priv/123abc/functionName. There's info on the feed pages about it.

Keen


Not a native English speaker.
But I'll let you point and laugh at my typos so I can fix them. :)

Keen

So, if anyone has been following this (other than me), all requests asked by the OP (which happens to be me) made it live with today's patch (made by me) to CIT:


  • "Alignment" field now lists the correct character alignment;
  • Custom character sorting is now applied to the feeds.

Thanks!

No problem!

;D

Not a native English speaker.
But I'll let you point and laugh at my typos so I can fix them. :)

GuyPerfect

Quote from: Keen on May 12, 2011, 07:59:57 PMThanks!

No problem!

;D

Keep doing awesome work and we'll keep letting you talk to yourself. (-:

DeProgrammer

You posted Waterworks, too! ... sooo I posted the news post. Only four weeks after I decided it was time to release it. :P