Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upJSON API for third-party apps / Lobsters iPhone App #42
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jcs
Dec 8, 2012
Contributor
I haven't done any JSON exporting mostly because the site already has a responsive/mobile view that works fine on phones and small screens.
Though I think the structure of the site is pretty well solidified by now, so a stable API can probably be added at this point.
|
I haven't done any JSON exporting mostly because the site already has a responsive/mobile view that works fine on phones and small screens. Though I think the structure of the site is pretty well solidified by now, so a stable API can probably be added at this point. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 8, 2012
Contributor
Yeah the mobile site is totally serviceable, however I think a native app could still provide a much better experience. I'll look into adding JSON as a response format later today if I get the time.
|
Yeah the mobile site is totally serviceable, however I think a native app could still provide a much better experience. I'll look into adding JSON as a response format later today if I get the time. |
added a commit
that referenced
this issue
Dec 17, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 17, 2012
Contributor
Just noticed you've started work on the API, I might throw together a basic iPhone app using it this afternoon if I have time. It'd also be great to include the number of comments and current score in that JSON.
|
Just noticed you've started work on the API, I might throw together a basic iPhone app using it this afternoon if I have time. It'd also be great to include the number of comments and current score in that JSON. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Ok, added those two in cb5e159 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 18, 2012
Contributor
Awesome, would it also be possible to add the created_at and updated_at info to the API? It'd help a lot cache expiration on the client side. Also do stories on Lobsters have regular, numerical IDs or just the short_id returned by the current API?
|
Awesome, would it also be possible to add the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jcs
Dec 18, 2012
Contributor
created_at is exposed now, there is no updated_at. I'd rather not expose any internal id numbers, so short_id should be used for stories. They are guaranteed unique.
User ids are being exported but they should probably use the username as the primary identifier, though usernames can change (not a big deal for caching though).
|
User ids are being exported but they should probably use the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 18, 2012
Contributor
No problem, my thoughts were that it'd make it easier to generalise some of my code but I've found a workaround anyway.
|
No problem, my thoughts were that it'd make it easier to generalise some of my code but I've found a workaround anyway. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Ok, removed |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 19, 2012
Contributor
Awesome, thanks for being so helpful in setting up this API. I've gotten most of the networking and Core Data caching code working in this iPhone app now, but as you can see the UI could use some work.
Also the source is up at rpwll/LobsterApp, I'll most likely change that name but I couldn't come up with anything clever yet.
|
Awesome, thanks for being so helpful in setting up this API. I've gotten most of the networking and Core Data caching code working in this iPhone app now, but as you can see the UI could use some work. Also the source is up at rpwll/LobsterApp, I'll most likely change that name but I couldn't come up with anything clever yet. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Nice! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 19, 2012
Contributor
Yeah I'll start skinning up the current app and add the Newest section to it, if you could at some point add individual posts and users to the API I can do like 80% of what I'd want to with this app. I think having a nice iPhone app could be a great way to get more people using the site.
Right now I'm trying to come up with a way to make nested conversations work well on the iPhone's narrow screen.
|
Yeah I'll start skinning up the current app and add the Newest section to it, if you could at some point add individual posts and users to the API I can do like 80% of what I'd want to with this app. I think having a nice iPhone app could be a great way to get more people using the site. Right now I'm trying to come up with a way to make nested conversations work well on the iPhone's narrow screen. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jcs
Dec 19, 2012
Contributor
Ok, I'll work on exporting more things.
You should post a link to this on /t/projects and get some feedback from other users.
|
Ok, I'll work on exporting more things. You should post a link to this on /t/projects and get some feedback from other users. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Yeah I plan to once I've worked on that mockup a bit more |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 19, 2012
Contributor
Okay here's what I've got so far, a few things that still need to be worked out:
- I'm not sure how to handle nested comments. Right now comments don't tend to get nested too deeply but that could always change and I want to have a flexible solution for that.
- Those vote up / down arrows next to each story and comment don't do anything. They're intended to let the user know if they've voted on a post and nothing more. However, right now they look like they're tappable buttons which could be confusing.
- I'm not sure if we'll be able to have write access in the initial version of the app, so a lot of that stuff might need to be left out.
- I'm not sure whether to handle URLs by opening them directly in the app or in mobile Safari. Perhaps this could be a preference but to me that just feels like not making a firm decision.
I might post this to /t/projects and get some feedback there.
|
Okay here's what I've got so far, a few things that still need to be worked out:
I might post this to /t/projects and get some feedback there. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Here's the thread if you want to comment |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 22, 2012
Contributor
I'm making some good progress with the app, can I get an ETA on being able to access an individual story and its comments from the API?
|
I'm making some good progress with the app, can I get an ETA on being able to access an individual story and its comments from the API? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jcs
Dec 23, 2012
Contributor
I'm heading out of town today so I probably won't be able to work on this until Friday or the weekend.
|
I'm heading out of town today so I probably won't be able to work on this until Friday or the weekend. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 23, 2012
Contributor
No problem, I'll probably take some time off too. Merry Christmas man.
|
No problem, I'll probably take some time off too. Merry Christmas man. |
added a commit
that referenced
this issue
Dec 30, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jcs
Dec 30, 2012
Contributor
You can access a story now by /s/(short id).json which includes a comments array.
|
You can access a story now by /s/(short id).json which includes a comments array. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Dec 31, 2012
Contributor
Awesome, thanks so much. I'll probably start work on stories tomorrow and aim for a usable alpha by the end of next weekend.
|
Awesome, thanks so much. I'll probably start work on stories tomorrow and aim for a usable alpha by the end of next weekend. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Jan 5, 2013
Contributor
Okay with the stories API in place, I've started thinking some more about what the single story view should look like, here's my initial stab at the idea:
A few notes about the design:
- Tapping the title of the post opens it in a browser, whether this is safari or an in-app browser like I'm using right now is stll to be determined
- Perhaps the font size for comments and post text is a little small? I might include a setting to change that
- When the user scrolls the comments, they slide up over the header, this is a cool effect I've seen in a few places and I think it'd work well here. However I still need to figure out what to do when we have really long post text in the header, maybe make it scroll to a point and then have comments scroll over it?
- Ideally I'd make usernames and tags tappable buttons but we don't have an API for that stuff yet
- I haven't figured out a way to act on comments yet
One thing that's noticeably missing here is the post and comments scores, I'm trying to figure out a good way to show those but I haven't figured it out just yet.
What do you think?
|
Okay with the stories API in place, I've started thinking some more about what the single story view should look like, here's my initial stab at the idea: A few notes about the design:
One thing that's noticeably missing here is the post and comments scores, I'm trying to figure out a good way to show those but I haven't figured it out just yet. What do you think? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Jan 6, 2013
Contributor
Also, do you have any idea if/when the API will add authenticated write access? I'd love to be able to post replies from my app.
|
Also, do you have any idea if/when the API will add authenticated write access? I'd love to be able to post replies from my app. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I'll have to look into integrating an OAuth endpoint. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Jan 6, 2013
Contributor
OAuth would be the best way to handle this, though I've never implemented OAuth in any of my rails apps so I'm unsure how time consuming that would be.
|
OAuth would be the best way to handle this, though I've never implemented OAuth in any of my rails apps so I'm unsure how time consuming that would be. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rhysforyou
Feb 1, 2013
Contributor
Alrighty, sorry I haven't given a ton of updates over the past month or so, I've been preoccupied with other projects, but I'm still definitely working on a Lobsters iPhone app. I've actually got a pretty solid build of the app running on my phone right now that I've been using to read Lobsters on my commute, it just needs a bunch of polish before I'd be willing to release it to the world.
Right now I'm trying to come up with a good name for the app so feel free to throw any suggestions out there. I assume I can't really call it Lobsters like I am right now. Anyway I plan to do a bunch of work on it this weekend with my plan being to launch it as a read-only client and gradually add other features as the API expands.
Thanks again for helping this project along!
|
Alrighty, sorry I haven't given a ton of updates over the past month or so, I've been preoccupied with other projects, but I'm still definitely working on a Lobsters iPhone app. I've actually got a pretty solid build of the app running on my phone right now that I've been using to read Lobsters on my commute, it just needs a bunch of polish before I'd be willing to release it to the world. Right now I'm trying to come up with a good name for the app so feel free to throw any suggestions out there. I assume I can't really call it Lobsters like I am right now. Anyway I plan to do a bunch of work on it this weekend with my plan being to launch it as a read-only client and gradually add other features as the API expands. Thanks again for helping this project along! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I guess this died :( |




rhysforyou commentedDec 2, 2012
I'd absolutely love a JSON API so people can build apps on top of Lobste.rs. I've been wanting to build an iPhone client for the site for a while but the lack of an easily accessible API has prevented that so far. I'd be happy to help implement this myself, I've got a bit of Rails experience, but I thought a feature this large warranted a bit of discussion.
To avoid having to deal with authentication at this point it'd probably be best to start it out as a read-only API. The main things I'd want access to as an app developer right now are the top and newest story sections and individual posts.
Have you thought much about the API so far?