Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Liam Peters
8,792 PointsBlog API Methods
Are there more API methods available to students than just "get_summary_recent". It would be pretty great to be able to get specific posts by ID. I've just finished the Android blog reader and am looking to expand upon it by retrieving articles, parsing them and displaying native. For no reason other than it sounds challenging and interesting! Thanks!
3 Answers
Ben Jakuben
Treehouse TeacherUnfortunately, not right now. We only have that one method available. You can see details here:
http://blog.teamtreehouse.com/api/info/?controller=core
You can see the methods available from the plug-in we are using here: http://wordpress.org/plugins/json-api/other_notes/#2.-Request-methods
Is there anything specific you'd like us to turn on? If you identify a method you think will work then I'll speak with the blog editor about possibly enabling it.
Liam Peters
8,792 PointsSeeing the get_post method, you pass in a post ID and get quite a reasonable response.
{
"status": "ok",
"count": 1,
"count_total": 1,
"pages": 1,
"posts": [
{
"id": 1,
"type": "post",
"slug": "hello-world",
"url": "http:\/\/localhost\/wordpress\/?p=1",
"title": "Hello world!",
"title_plain": "Hello world!",
"content": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!<\/p>\n",
"excerpt": "Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!\n",
"date": "2009-11-11 12:50:19",
"modified": "2009-11-11 12:50:19",
"categories": [],
"tags": [],
"author": {
"id": 1,
"slug": "admin",
"name": "admin",
"first_name": "",
"last_name": "",
"nickname": "",
"url": "",
"description": ""
},
"comments": [
{
"id": 1,
"name": "Mr WordPress",
"url": "http:\/\/wordpress.org\/",
"date": "2009-11-11 12:50:19",
"content": "<p>Hi, this is a comment.<br \/>To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.<\/p>\n",
"parent": 0
}
],
"comment_count": 1,
"comment_status": "open"
}
]
}
Something like the following maybe?
http://blog.teamtreehouse.com/api/get_post/?post_id=xx
If not, it's not the end of the world. Was just looking for an interesting extension/challenge to the project
Ben Jakuben
Treehouse TeacherYes, I think it's a good idea! We're about to break for the weekend (we don't work Fridays), but I'll follow-up about adding that next week.
Liam Peters
8,792 PointsThis here is why Treehouse is better than other platforms. Large online e-learning and yet very personal! Thanks for that, enjoy your three day weekend (you lucky person!)
Liam Peters
8,792 PointsFound out that you could fetch a user profile by adding ".json" to the end of one of the profile link. Sufficed to say I made an app: Video of app Github Repo I'm not all the comfortable with Github still so I'm sure if you visit it you'll see a lot of rookie errors, but I don't think it's terrible for my first go Also of course this is only for learning purposes!
Ben Jakuben
Treehouse TeacherThis is great! I missed the reply and just saw it. I just tweeted the link: nice work!