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.