My Opera Development

Behind the scenes at My Opera

Subscribe to RSS feed

Posts tagged with "api"

Status update API

, , , ...

My Opera status update API is finally, and officially, live!

There's some documentation you can look up on our API page, and there's also a full Dev Opera article on how to use it, plus a nice introduction to OAuth if you need it. OAuth is also used by the Opera Link API.

Now there's no excuse not to use the status API ;-) We have put together some code you can use to really simplify the interaction with our API. For now we have integrated the status, but I hope we will get more time to expand the API with pictures upload, and other goodness.

There's a shiny Perl module, soon there's going to be a PHP example too, but if you have any requests, speak up or even better, come up with your own patches or versions. Have fun!

Embedding My Opera content (OEmbed)

, , ,

Now you can embed photos and other My Opera content like avatars from external sites. It's been on our roadmap for some time.

We chose to embrace the OEmbed (www.oembed.com) "specification" for doing that.

OEmbed it's really simple. It uses JSON (or XML) as an interchange format, and the request and response types are really simple and straightforward. An OEmbed request has the following structure:

http://my.opera.com/service/oembed?url=<some_url>&format=json

The format is json by default and can be omitted, so a sample request to get information about MyOpera photo album looks like:

http://my.opera.com/service/oembed/?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Falbums%2Fshow.dml?id%3D504322

This is one of my photo albums. The result is the following:

{
  "author_name" : "cstrep",
  "provider" : "My Opera Community",
  "images" : {
      "image" : [
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964560",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964559",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964556",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964558",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964531",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964554",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964557",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964555"
      ]
  },
  "author_url" : "http://my.opera.com/cstrep/",
  "provider_url" : "http://my.opera.com/",
  "version" : "1.0",
  "type" : "link",
  "title" : "Italian Day"
}

Note: if you have problems displaying the JSON code and you're faced with a download instead, try to instruct your browser to open application/json mimetype directly. In Opera, just go to the Tools menu, Preferences. Click on the Advanced tab, then Downloads on the left. You can see all the special mimetypes. Now click on Add, and insert the application/json mimetype and tell Opera to open it directly.

You can also recursively request information about a single picture, using:

http://my.opera.com/service/oembed?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Falbums%2Fshowpic.dml%3Falbum%3D504322%26picture%3D6964560

The result is:

{
  "width" : "2080",
  "author_name" : "cstrep",
  "provider" : "My Opera Community",
  "author_url" : "http://my.opera.com/cstrep/",
  "provider_url" : "http://my.opera.com/",
  "version" : "1.0",
  "height" : "1544",
  "url" : "http://files.myopera.com/cstrep/albums/504322/100_2450.jpg",
  "title" : "Giardinelli Beach. Sardinia.",
  "type" : "photo"
}

So, there you have it, the filename of the picture, finally...

The base implementation for this OEmbed functionality is completely generic and open. Then we have a bunch of different plugins, like Photo, Avatar, Album, and so on... And it's really easy to add new ones.

We're now planning to use this API internally for new features already planned. Hopefully also widgets.opera.com will use OEmbed internally to access avatar pictures. Here's an example:

http://my.opera.com/service/oembed?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Favatar.pl

If you prefer the xml format instead, you can append the format=xml argument to the URL, like in the following example:

http://my.opera.com/service/oembed?format=xml&url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Favatar.pl

Of course, not everything is accessible to any user. Private albums will remain private. Anyway, the main point of OEmbed is being able to share content, so... have fun.

Support for Moveable Type API

,

Not everyone prefers to write their blog in a web browser, and quite a few specialised clients have been made to post content to blogs, using one or more of the APIs that exist for the purpose.

We decided to provide support for most of the Moveable Type API, which also includes elements from the Blogger API and the MetaWeblog API. To aid tools in figuring out that we have this support, we also support the Really Simple Discovery specification.

To get an overview of the URL to use for the API, after your username you can add
/xml/rsd


To make that long story short, the URL to use for the API is
http://my.opera.com/<username>/blog/api/


This new feature may be a little rough around the edges, but we think it will get the job done, so we hope you will enjoy it!