Skip navigation.

Web Applications Blog

Posts tagged with "chat"

Widget World Cup: Transcript

, , ,

We had some great questions last night about the Widget World Cup. Thanks to everyone who attended and made this easily our best chat yet.

We're planning another one at the same time next week, but the topic will be revealed on Monday. Stay tuned for more.

And lastly, congratulations to grafio for winning our random chat t-shirt prize this week.

Good luck to everyone entering widgets - go out there and get your friends to try them out - and Opera might just hand you €3,000.
---------------------

OperaWebApps: Hi everyone. Welcome to today's chat session on the Widget World Cup.

Question from dantesoft: I am working on a widget to help me (and english speaking people) learn Serbian. I am Romanian. I'd want to tag the widget as international... (RO is doing poorly in the championship)
OperaWebApps: Hi Dantesoft, you can add other tags to the widget to specify the other languages and categories. But for the widget world cup, use Romania. We also lowered the bar for qualification: countries need only 5 widgets and 500 downloads of each widget to qualify.

OperaWebApps: Right now, the following countries have qualified: Australia, Austria, Brazil, Germany, Poland, Russia, UK, and the U.S.

Question from Ramunas: So which country is winning?
OperaWebApps: The World Cup has two stages - the qualifying and then the final (kind of like the real World Cup). So right now, all that matters is how your widget does domestically against the other widgets. Then we let all the country winners battle it out. In another way of looking at it, the most downloaded widget from each of those eight countries we listed will win €1,000.

OperaWebApps: Italy is on the cusp of qualifying, so the most downloaded widget there will win €1,000.

Question from dantesoft: Is it too late for 'team (east) Europe'?
OperaWebApps: If you consider Poland and Russia Eastern Europe, I think we have a good representation. :smile: But hey, with the new rules in place, doesn't that make it easier to win?

Question from shadow: dom.js(i found it inside the animation dwl file) is it one of the 10 libs that opera is developing?

OperaWebApps: The chat about the libraries will happen in a few weeks.

OperaWebApps: The dom.js file is a helping library for our other libraries. So...yes :smile:

Question from dantesoft: I see qualified widgets come in all shapes and sizes. What are the minimum requirements? the ones in the OC Widgets blog?
OperaWebApps: The widget you're talking about was uploaded and approved before the style guide existed.

OperaWebApps: Since we can't go back and delete all the widgets, we instead ask that all new widgets conform to the style guide.

OperaWebApps: And we've gone back and asked earlier widget developers to review their widgets in accordance with the style guide.

Question from shadow: Did the rules change?where are the new ones?

OperaWebApps: We are updating the Widget World Cup page. By tomorrow it should be fixed.

OperaWebApps: Note that the baseline is now 5 widgets and 500 downloads to qualify the country.

Question from jadd: Is someone logging this for those (me included) who missed the first few minutes of this chat?

OperaWebApps: Yes we are logging it and, just like the last chat, the transcript will be posted on the Web Applications blog.

Question from babox: I made a widget for Mexico, but I live in Italy and I made other widgets for Italy. I don't think, but what would it happen if I win in both countries?

OperaWebApps: The one rule we have is that you have to live in the country that we send the money to, so unfortunately you could only win for Italy. Mexico would default to the next most-downloaded widget.

Question from dantesoft: How do you comment (on) the allegations that some national teams used performance-enhancing libraries ?
OperaWebApps: We take a hard stand against doping - by using the Widget Style Guide

OperaWebApps: But feel free to use any performance enhancing libraries, especially ours. (more coming soon...)

Question from shadow: What do I have to do to submit one already posted widget to into the competition?

OperaWebApps: Simply go back and edit your widget to tag your country. Simple process. We want to get as many countries qualified as possible.

Question from dantesoft: What about stats: number of updates per widget, visits, downloads.. ?

OperaWebApps: Good suggestions. We do keep records, but we currently only display the best week and the most recent week

OperaWebApps: It's a good idea though and we'll look into it.

OperaWebApps: Remember that making the widget is only half the battle. The other half is promoting it to your friends, on your blog, to colleagues, etc. Anyone have good strategies they want to share?

Question from just-a-nick: Is there any hope for countries like Canada?
OperaWebApps: Of course. Because we lowered the threshhold, Canada only needs two new widgets with 500 downloads. The Daily Crossword widget just needs a few more downloads. So Canada can qualify no problem.

OperaWebApps: You have more than one month and a half.

OperaWebApps: The new rules stipulate that each qualifying country need 5 widgets with 500 downloads each. That's pretty easy.

OperaWebApps: Everything will be updated at http://widgets.opera.com/wwc/

OperaWebApps: We just figured we'd give you guys the early heads up...

Question from grafio: I've read here about some "eastern Europe" country. Are you going to do this? I understand why you lowered minimum requirements, because the final competition wouldn't be fun with 1 or 2 countries, but I think this "eastern Europe" change would be very unfair.

OperaWebApps: We're still sticking with individual countries. Every country deserves it's own chance.

Question from shadow: Do widgets made with widgetize qualify as a valid widget?for the competition ?

OperaWebApps: Yes they do, but don't forget they still need 500 downloads.

OperaWebApps: So promotion is the key.

OperaWebApps: And don't forget it's the highest number of downloads during each widget's best week that will win the national competition.

Question from babox: Do you think to organize other competitions in the future?
OperaWebApps: Absolutely. Feel free to post your suggestions in the Web Applications blog or the widgets blog.

Question from dantesoft: What is the policy on incremental developing, v0.1, v0.2, .. when the author encourages users to come back and download the new version?
OperaWebApps: We have no problems with that.

OperaWebApps: If it makes the widget better, that's better for the users. And we definitely encourage more downloading of the widget.

Question from grafio: Is conforming with the widget style guide mandatory now in WWC?
OperaWebApps: The Style Guide isn't retroactive

OperaWebApps: But now to get the widget posted on the site, you need to follow the style guide.

Question from grafio: What do you think about an idea to make the Widget World Cup every year?
OperaWebApps: What? You don't want it every fourth year?

OperaWebApps: No, we'll certainly consider running this again. Especially if we get more countries qualified.

Question from dantesoft: what about help from Opera's widget specialists ? available on request, like before ?

OperaWebApps: You're welcome to post things on the forum, which hopefully will be community-driven.

OperaWebApps: If you don't get the help you need, I'm sure there are Opera widget developers who will help you out.

OperaWebApps: Opera developers monitor the forums closely and respond whenever they can.

Question from shadow: Do widget which are made to show case a new way of doing things aka proof-of-concept kind of widgets qualify?

OperaWebApps: As long as they follow the style guide. And remember it's a popularity contest, so maybe a proof-of-concept would generate a lot of interest.

OperaWebApps: These widgets can be added to the "tools" category on the Web site.

Question from dantesoft: yes, about that, how friendly do you expect to be comments to be from arch-rivals? :smile:

OperaWebApps: Could you repost about the arch-rivals? Do you mean the forums?

OperaWebApps: Ok...here we go. Next question submitted to Pony and accepted will win a t-shirt.

Question from grafio: You lowered the requirements, but aren't you afraid it may be to hard to pass 25 000 downloads in 3 weeks? From my experience it's hardly possible (especially for old widgets)?

OperaWebApps: Congratulations Grafio, you just won yourself another t-shirt. :smile:

OperaWebApps: We'll consider that, but the ultimate goal is to get really cool widgets out there, and to get lots of widget downloads.

Question from dantesoft: Yes, i'm all for national pride, but there's money involved (jk)

OperaWebApps: We understand. Just remember to play nice. If you have any extreme issues, try searching the forums for info.

OperaWebApps: If you still don't find what you need, you can message the Opera Widget Developers, but don't expect an answer too fast.

OperaWebApps: We're trying our best to give you the best widget experience.

OperaWebApps: And hopefully you guys will help us create the best widgets

Question from grafio: Thanks, I'm lucky today. :smile:
OperaWebApps: You are welcome - thank you for your great widgets.

Question from shadow: Who can we thank for comming up with the idea of widgets inside opera?
OperaWebApps: The same people that created tabbed browsing, integrated BitTorrent client, start where you left off, blah blah blah...

OperaWebApps: Four minutes left...any more questions?

OperaWebApps: If you want any ideas for promoting your widgets to get downloads, feel free to ask..

Question from grafio: What if none widget will pass 25000?
OperaWebApps: What? You don't think it's possible?

OperaWebApps: There are still a couple of months left before the final. It is up to you to determine how popular widgets will become.

Question from grafio: It is possible but it is possible that none widget will have more than 25k.

OperaWebApps: Yes that is true...we hear you but we don't believe you. :smile: If by chance it does happen, we'll figure out what is fair and what works best for everyone.

OperaWebApps: Thanks a lot everyone. Have a nice evening. This chat will be posted on the Web Applications Blog for everyone to see. Until next time...OperaWebApps signing off.

Event Streaming to Web Browsers

, , , ...

One cool feature we added to Opera 9 is Server-Sent Events from the WHATWG Web Applications 1.0 specification. Using SSE you can push DOM events continously from your web server to the visitor's browser. This creates a lot of exciting opportunities for web application authors.

Traditionally, when building an Ajax application, the browser continually polls the server, sending requests to the server, asking to get data back, making new HTTP requests for every single poll, putting more strain on the server than needed.

The event streaming approach instead opens a persistent connection to the server, sending data to the client when new information is available, eliminating the need for continuous polling. This method for doing remoting offers a tremendous advantage, since the server no longer has to handle the overhead associated with clients asking for new data. Instead, the server simply sends back data every connected client when appropriate, thus reducing the load on the server, with the added advantage of offering instant feedback to the user.

Opera Web Chat

Opera Web Chat Screenshot To provide you with a starting point on how to build your own event streaming application, we have built Opera Web Chat. This is a web based chatroom offering some of the features from the built in to the Opera IRC client. Currently the chat only offers one single chatroom. (A screenshot is available here)

Keep in mind that it is an experimental service, which means it may not always be available for use.

How to use Server-Sent Events

To use Server-Sent Events in a web application, add an <event-source> element to the document, with a src attribute pointing to a event source URL. This URL should provide a persistent HTTP connection that sends a data stream containing the events. The connection must use the content type application/x-dom-event-stream.

It is possible to send events with any name, and specify the properties of the event object. Opera 9.01 only supports the data property of the event, so this is what we are going to use in these examples.

The server side event source writes the events whenever they occur, and sends them over HTTP to the client. This is a basic example of event data. This is more thoroughly explained in the specification.

Event: server-time
data: [time on the server]

Event: the-answer
data: 42

This will send two events to the browser, and it's possible to catch them as DOM events. The following JavaScript example listens for the "server-time" event, and alerts the content.

document.getElementsByTagName("event-source")[0]
        .addEventListener("server-time", eventHandler, false);

function eventHandler(event)
{
    // Alert time sent by the server
    alert(event.data); 
}

This is a very simple Python CGI example which sends a new event every 3 seconds. Every event is named "server-time", and sends an event with the data property set to the current time of the server in seconds.

Keep in mind that when a CGI script outputs data, there is no guarantee that it is sent immediately. There are often caching mechanisms and so on in place. For this reason it may be necessary to explicitly flush the output.

Here is the example code written in python.

#!/usr/bin/python
import sys
import time
print "Content-Type: application/x-dom-event-stream\n\n"

while True:
    print "Event: server-time"
    print "data: %f\n" % (time.time(),)
    sys.stdout.flush()
    time.sleep(3)

The same example written in PHP:

<?php
header("Content-Type: application/x-dom-event-stream");
while(true) {
    echo "Event: server-time\n";
    $time = time();
    echo "data: $time\n";
    echo "\n";
    flush();
    sleep(3);
}
?>

Opportunities

In addition to the chat application we made, there are lots of different applications that can be made with Server-Sent Events. For instance games or instant messaging clients, such as MSN Messenger, Jabber or AIM. You could also build stock and news tickers, status and log file monitors, or anyhing you can come up with.

What will you build?