summaryrefslogtreecommitdiff
path: root/_posts/2010-06-10-moosex-net-api-update.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--_posts/2010-06-10-moosex-net-api-update.md (renamed from _posts/2010-06-10-moosex-net-api-update.textile)50
1 files changed, 23 insertions, 27 deletions
diff --git a/_posts/2010-06-10-moosex-net-api-update.textile b/_posts/2010-06-10-moosex-net-api-update.md
index 155b691..452038e 100644
--- a/_posts/2010-06-10-moosex-net-api-update.textile
+++ b/_posts/2010-06-10-moosex-net-api-update.md
@@ -1,10 +1,10 @@
---
layout: post
-category: perl
+summary: In which I write an update about MooseX::Net::API
title: Moosex::Net::API - update
---
-"MooseX::Net::API":http://github.com/franckcuny/moosex-net-api is a module to help writing clients for RESTful (and even non-RESTful) WebServices:
+[MooseX::Net::API](http://github.com/franckcuny/moosex-net-api) is a module to help writing clients for RESTful (and even non-RESTful) WebServices:
{% highlight perl %}
package my::api;
@@ -50,21 +50,21 @@ expected: 200, 404
It's not yet complete, but a new version will be available soon on CPAN. Here is a list of some more features I plan to add quickly:
- * better internal API
- * better authorization support (OAuth!)
- * add more methods to provide better introspection
- * better unserialization
- * more tests and better documentation
- * generate POD via a PODWeaver plugin ?
- * plugins ?
- * renaming ? (not sure it really fits in the MooseX:: namespace)
+* better internal API
+* better authorization support (OAuth!)
+* add more methods to provide better introspection
+* better unserialization
+* more tests and better documentation
+* generate POD via a PODWeaver plugin ?
+* plugins ?
+* renaming ? (not sure it really fits in the MooseX:: namespace)
-h3. http-console
+## http-console
-I've also started "*Net::HTTP::Console*":http://github.com/franckcuny/net-http-console. It's inspired by "http-console":http://github.com/cloudhead/http-console. It relies on MX::Net::API, and can use any libraries written with MX::Net::API, as well as any *raw* RESTful API. As an example, let's use it on twitter.
+I've also started [Net::HTTP::Console](http://github.com/franckcuny/net-http-console). It's inspired by [http-console](http://github.com/cloudhead/http-console). It relies on MX::Net::API, and can use any libraries written with MX::Net::API, as well as any **raw** RESTful API. As an example, let's use it on twitter.
{% highlight bash %}
-http-console --url http://api.twitter.com --format json
+% http-console --url http://api.twitter.com --format json
http://127.0.0.1:5984> GET /1/statuses/public_timeline
[
@@ -91,21 +91,21 @@ You can call any method from the twitter API (at the exception of the ones that
You can also use it with any library that uses MX::Net::API:
{% highlight bash %}
-http-console --lib Net::Backtweet
+% http-console --lib Net::Backtweet
http://api.backtweet.com> help command
available commands:
-- tweets_by_url
-- stats_by_url
-- good_tweets_by_url
+- tweets\_by_url
+- stats\_by_url
+- good\_tweets_by_url
-http://api.backtype.com> help command tweets_by_url
+http://api.backtype.com> help command tweets\_by_url
name: tweets_by_url
description: Retrieve tweets that link to a given URL, whether the links are shortened or unshortened.
method: GET
path: /tweets/search/links
-http://api.backtype.com> stats_by_url {"q":"http://lumberjaph.net","key":s3kr3t"}
+http://api.backtype.com> stats\_by_url {"q":"http://lumberjaph.net","key":s3kr3t"}
{
"tweetcount" : 388
}
@@ -122,16 +122,12 @@ Arguments to the methods are serialized in JSON format. Not sure if it's the bes
}
{% endhighlight %}
-It's far from being complete at the moment, but I will extend it quickly. Right now, you can define global headers, and get help for all methods in your MX::Net::API library. Authentication is on top of my priority list, as is alias creation, so instead of doing (on a non-moosex::net::api lib):
+It's far from being complete at the moment, but I will extend it quickly. Right now, you can define global headers, and get help for all methods in your MX::Net::API library. Authentication is on top of my priority list, as is alias creation, so instead of doing (on a non-moosex::net::api lib): `GET /users/` you will do:
-bc. GET /users/
-
-you will do:
-
-bc. alias users/:country as users
+> alias users/:country as users
then:
-bc. users {"country":"france"}
+> users {"country":"france"}
-(and yes, I've switched from wordpress to "blawd":http://github.com/perigrin/blawd)
+(and yes, I've switched from wordpress to [blawd](http://github.com/perigrin/blawd)).