Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build API for selvvir commands #1

Open
pudly opened this issue Nov 24, 2013 · 8 comments
Open

Build API for selvvir commands #1

pudly opened this issue Nov 24, 2013 · 8 comments
Labels
Milestone

Comments

@pudly
Copy link
Contributor

pudly commented Nov 24, 2013

As discussed, lets get a JSON api going for all the selvvir commands, I'll build out everything to absorb it on the front

@ghost ghost assigned AMcBain Nov 24, 2013
@AMcBain
Copy link
Contributor

AMcBain commented Nov 24, 2013

Do you care to have the URLs in the factoid values delimited in some manner? I think it inappropriate to deliver markup of any kind in the value (as that makes an assumption) but perhaps as a list of indexes. It's easy to do it but if you wouldn't use it, then no need for me to bother. I already do it in some form for the dump visible at https://selvvir.asmcbain.net/factoids

@AMcBain
Copy link
Contributor

AMcBain commented Nov 24, 2013

I can also potentially offer a more concise API output if I don't need anything other than just the raw name to values.

@oksushi
Copy link
Contributor

oksushi commented Nov 24, 2013

Could be handy to break the factoids out into cue:text:url groups, like:

["alot","Beware of the Alot","http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html"]

@AMcBain
Copy link
Contributor

AMcBain commented Nov 24, 2013

Some have more than one URL, though.

Some thoughts I had, and these are by no means exhaustive of the options or the only combinations of sub bits:

{
    "key1": {
        "value": "this is a value with a URL: http://example.com and following text",
        "urls": {
            "28": 45
        }
    }
}

[{
    "name": "key1",
    "value": "this is a value with a URL: http://example.com and following text",
    "urls": [[28,45]]
}]

Without any extra info included, then there's no need to for a sub object and I could provide:

{
    "key1": "value1"
}

The only issue with the top-level-map ones is that there's no default ordering that can be implied (like alphabetical).

@AMcBain
Copy link
Contributor

AMcBain commented Nov 24, 2013

At least as a quick temporary for review I've got https://selvvir.asmcbain.net/api/factoids and https://selvvir.asmcbain.net/api/factoids/simple running. The former does the second idea in the first box in my previous post, and the latter does the idea in the last box. The former actively indicates aliases, the latter dumps an internal representation. We can tweak what we want from at least seeing those--such as perhaps having aliases return the value of the factoid they point to instead of being marked as an alias--and get rid of the URLs we don't want.

Also, they're like my existing website: one large dump. An alternate API URL as part of offering ways to access the non-admin commands will be available to return only matching factoids instead of all when I get there. It'll return the preferred output we decide upon here.

@pudly
Copy link
Contributor Author

pudly commented Nov 25, 2013

This looks great, i'll do a quick parser by Tuesday, just finished implementing foundation framework on the front end of things, and wrote the jekyll structure for the wiki section

@AMcBain
Copy link
Contributor

AMcBain commented Nov 25, 2013

The commands: https://selvvir.asmcbain.net/api/commands
This doesn't include the usage bits (how to use flags, or the "@" syntax), but I consider those in stone: I don't foresee myself changing them. So the paragraphs and such about that ( https://selvvir.asmcbain.net/ ) can be copied without a real fear of going stale.

I also now have https://selvvir.asmcbain.net/api/factoids/flat which is the same as the base /api/factoids list-based results except aliases are expanded to the same value as what they point to. One of these will end up being useful ...

@AMcBain
Copy link
Contributor

AMcBain commented Nov 25, 2013

Except for admin-only commands, I can make available an ability to call the commands listed by /api/commands if wanted, but I don't know if this is of use, and some of them like g, v, and short can be interfaced directly to the original services if needed instead of going through an extra layer (Selvvir's code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants