Espanol  |  English      

Archive

Archive for the ‘Development’ Category

Dealing with Facebook Platform latency issues

December 11th, 2009

A few days ago we started getting a “The URL … did not respond.” error in some apps that we were developing. We thought it could be caused by a Server Issue and we didn’t pay too much attention, but yesterday it started happening all the time, and there was no way to find a “pattern” of why was this being caused.

So we spent a couple of hours with Altodot’s hosting partner Atha Kouroussis ( Co-Founder at Vurbia Technologies) analyzing what was really happening, if it was a server problem, buggy code, or Facebook issue, and finally we found a way to fix this eternal errors thrown by Facebook.

One of the things we found is that some of the apps we made using IFRAME to run inside facebook were running slowly, but Ok anyways. So we started focusing on why would a FBML application fail when an IFRAME app doesn’t fail.

To confirm the post made by “Inside Facebook Blog” announcing Facebook’s API latency issues, when we started debugging the application we saw that the execution of the FQL queries was taking different response times, between 0.5 and three seconds generally, but suddenly appeared requests taking more than ten or even twenty seconds to run (including some other requests throwing zero records when they were supposed to retrieve existing records). The interesting thing was that it had nothing to do with the query itself, or the amount of records it was requesting…

That only explained why it was taking so much time to run the IFRAME apps, but why FBML applications were failing like that?… We took a deep look at the time it was taking to run all the FQL queries and we found that if the whole php execution was taking less than 12 seconds the FBML application worked fine, but if the response times of each FQL query (plus the time spent on the execution of the script) was over 12 seconds it failed.

The interesting thing here was that even when facebook throws the “URL did not respond” error, the execution of the script did not throw any exception and the logs on the web server showed a perfect delivery, instead of stopping the request it always finished it’s execution! no matter how much time it was taking to Facebook’s API to answer those requests.

We have the diagnosis so far, and it’s basically that facebook response latency is taking too much time, specially more that 12 seconds that it’s the time Facebook is going to wait for the output of your script before it starts parsing your HMTL + FBML tags on it.

Even when it clearly wasn’t our fault, that’s not an explanation that would make our clients feel happy or safe (Specially when we’re a company specialized on Social Apps), so we started brainstorming a few hours to get some kind of workaround.

We realized that we needed to do a redirection to the same page if the execution of the script takes more than 10 seconds to run, but since our app was built on PHP, we couldn’t check It the time elapsed after each query was less than 12 seconds, because only one query could take even 20 seconds and Facebook would throw the error before we have a chance to redirect the page.

The list of the possible solutions (after trying everything we found on Facebook Dev Forums) was too stretch, there were only three ideas:

  1. Pray for Facebook to take care of the latency issue (or extend,the output timeout),
  2. Change all the code to make the application run inside an IFRAME replacing all the FBML tags & FBJS scripts (obviously this was the latest thing we would do)
  3. Paralleling the calls to FQL servers.

Finally, the way that I solved the issue was simulating php threading by making calls through CURL to a processor file that takes care of making the FQL call to facebook, and while all the queries are being requested by multiple calls on curl on the main script we’re just looping and asking if those requests finished before 10 seconds. If that’s the case, we just let our script finish it’s execution, but if Facebook slowed at least one of the several FQL requests more than 10 seconds we just make a redirection to the same page passing all the parameters along with the redirect again. That way (and because Facebook usually didn’t  fail two times consecutive) it only takes 5 to15 seconds for the user to get the application content (not the 35 that could be on an IFRAME app if facebook takes 20 seconds to respond a query).

That said, let me share with you a working PHP sample script (commented) similar to what we’ve used to avoid facebook latency that you can download from here. Feel free to post any questions or comments about it.

Best,

Matias Paterlini

paterlinimatias Development, Facebook, Social Network, Uncategorized , , ,

Facebook Apps - Virality vs. Engagement

November 23rd, 2009

As you probably know, Facebook announced two weeks ago a huge roadmap of what’s coming to the FB Platform in the next 6 months. It quickly became a disturbing news for all the Million Facebook Developers out there… (according to Facebook Statistics revealed in the last FB Garage in SF).

Not only the 350.000 applications delivered during the last two years won’t work in the next couple of months months, but also the developers of those apps now will have to learn how to replace the original app features to something else, using the new viral channels, new API implementations, new methods, parameters, variables, and so on…

Not even mention clients who now need to pay extra money for closed projects to keep them living, all of these within 6 months, but wait, only two weeks after the announcement there are things that are no longer working, such as feed templates registration.

That said, I think there’s (at some point) a Good Reason about why Facebook is doing this to all of us. There are a couple of interesting points that I see as a great result on the Platform Refactor that we’re living right now, and I want to share one of them with you.

As a Start, what I call the “comments linking”. Suppose that you have some kind of content on your application, let’s say you have a Trivia game and you save people results. The way it worked so far, basically you could have a comment box associated with a “comment ID” related to some content (“the trivia result”). In addition to that, we also had a feature that allowed us to publish a Feed Story related to some kind of user action (made inside the application) to the users’ wall, such as beating a friend on a challenge. Both comment box & feed publisher were great tools, but all the likes, shares and comments made on the feed story weren’t reflected to the comment boxes and vice-versa… and that was pretty much disappointing.

With the new upcoming changes, we will be able to relate those tools to a certain “content ID”, which I believe it will definitely EXPLODE the virality of an app, absolutely more than the spamming notifications. If we are able to merge all the comments, likes and shares over the same content, it will definitely take less to appear as a hightlight on the new feed helping the user to remember about our app constantly!.

Perhaps we will need to start thinking on doing more serious apps based on user generated content”, instead of Viral Channel Spamming Apps which was the preferred model by many developers around the world during the last year.

The way developers were doing some money when the platform was released was providing virtual currencies and using micro-payments, but it was a hard and expensive job to develop those applications. A year ago people started this new revenue model that was based on generating lots of page views (exploding viral channels to the most) in order to get more money from ad networks.

I think behind this refactor made by facebook, basically they’re looking to go back to the first apps model which brought them high quality and engaging applications instead of the 1 day coding apps based on the second model.

I know virality is key to success, but once you get those million users on your app, what will you do to generate more page views?

A couple of months ago, I developed a viral application to study the way small apps grow, and it that took less than three weeks to get 2 million users using the app, and it took us 4 - 5 weeks to loose all the traction it gained during the initial three weeks.

Why is that possible? because the application basically did not allow you to do anything but clicking on a button to get more friends, and publishing stuff to the user’s wall.

And we found something interesting, the “One Action Applications” is a proved concept! Believe me, there’s some people out there who fell annoyed when you offer them lots of things to do inside an app. So, when they find that the only thing you can do is publishing something to your wall… well, you will pretty much feel like doing it, cause there’s nothing else to do, It’s Crystal clear!

That was our application model. We gained virality because each one of them published the feed story, but right after they clicked on the “Publish Button” they were GETTING BORED!

So, we gained virality, BUT were did all that go ?? nowhere! we lost them!. Somebody said once: “There’s only one time to give a initial good impression”.

The good thing on this equation is that there’s a “collateral benefit” that about 5% of users which used the application and got bored of it, BEFORE forgetting about us they leaved us a gift, They Pressed the RED Button (some to speak…) they became fans of our App. So, you must be asking yourself what is the pleasure of having bored users on your boring application profile… and I say, You Probably don’t have them Engaged with you, But they’re engaged for sure, cause now you will be able to share with them all the new applications that you will be releasing.

As a conclusion, viral based applications don’t usually have a long term relationship with their users, but they’re definitely a great marketing channel for new applications which still makes it an interesting business for some companies. On the other hand, Engaging applications are clearly what Facebook is looking for, and developers will find more and more tools to keep fluid communications with their users as the platform’s community grows day by day.

Matias Paterlini

Article Originally written for PulsoSocial.com
URL to Original Post: http://pulsosocial.com/2009/11/22/facebook-apps-virality-vs-engagement/

paterlinimatias Development, Facebook, Social Network , ,

Finally, a Ustream Video Downloader!

October 30th, 2009

At AltoDot Labs we created a simple tool that allows you to download videos recorded at Ustream.

Click here to see it working!

We believe this is a very useful tool since it allows you to get a direct link to the video file (in flv format) of every video recorded at Ustream.

Best!,

Matias

paterlinimatias Development ,

Never Give Up!!

December 7th, 2008

Before writing feedback on a website, web application, software, or anything like that, we always doubt if anyone is really going to work on our comments, suggestions, bugs, or if anyone will at least read them!.

The day that Cuil search engine was launched, I made a suggestion about a terrible, simple and well known style bug in their homepage. I never knew anything about that, so this is something that I’ve been throug before, but let me tell you another story.

There was a common bug on Facebook, something posted in 4 threads means to be very common, it was about an “Add to profile” button not being rendered on Safari Browser.

I saw many comments and replies on each thread (and also in the official thread) about the bug. Last answer was a couple of months ago.

I should admit that I wasn’t really expecting an answer, but anyway, I decided to send a reply and an direct email to the developer “working” on the issue telling about a workaround I found to make it work. After 2 replies, 2 days later Voilá!, the bug was fixed.

Sometimes our feedback is SO poor, some other times we don’t even send it, and even worst, we don’t follow the resolution of the bug checking if we left any information about the bug missing… that makes us useless, and we let the developers helpless (I’m a developer too, I know what it feels).

So, this is more about a social conscience post, to persuade those guys that forget about the devs life’s behind a fogbugz, bugzilla, trac, bugtracker, etc. platform!!

And second rule is, no matter how much time have passed, if the bug you’re searching haven’t been fixed yet, you always have the chance to get an answer or even better, you could be the one that fix the bug!

Never give up!

Matias Paterlini

paterlinimatias Development, Facebook , , ,

De-bee - The Best online debt sharing solution, just released

November 9th, 2008

For those that still don’t have an online debt sharing system, we just released De-bee!! give it a try at www.de-bee.com.

De-bee was developed at Manas Technology Solutions (www.manas.com.ar). It’s first beta release was built during a hackathon day a few weeks ago by 15 developers. I’m very proud to be one of them!!!

It was developed in Python using Google App Engine services, and django for the templates.

You can meet Ary at http://weblogs.manas.com.ar/ary/ , he had the idea, and he pushed us to follow him, Thanks for that Ary, this is a great tool for the world!

Cheers!!,

Matias Paterlini

paterlinimatias Development , , , , , ,

Maverick Quiz launches on Facebook

November 1st, 2008

Take the 2-minute Maverick Quiz

http://apps.facebook.com/maverickquiz/

We are still developing our templates for Facebook apps. Now we have the quiz routine so we can hit topical subjects like this.

Tell your friends. Use game invites and send email. This one should go pretty fast we think.

Regards,

Matias Paterlini

paterlinimatias Development, Facebook, Social Network , , , , , ,

Facebook Conference Photos…

September 30th, 2008


Here you can see some pictures about the facebook development conference at Fasta:

Thanks to Ignacio Repetto and  Red Estudio for the photos!!!
Matias Paterlini

paterlinimatias Development, Facebook, Open Social, Social Network , , ,

Great day at Fasta University

September 27th, 2008

Yesterday I presented a conference about facebook apps development at Fasta University.

It was a great time, and there are new oportunities to make the presentation in other companies and universities soon. There is a posibility to make a webcast too, so I’ll keep you informed about updates.

You can download the presentation here (it’s spanish mostly, english presentation coming soon):

http://www.paterlinimatias.com/presentations/fasta-2008.pptx

Thanks to all the devs that came to the conference, it was nice to share that time with you.

Cheers!!!

Matias Paterlini

paterlinimatias Development, Facebook, Open Social, Social Network, Uncategorized , , , , , ,

Great time at MTV Latam building a facebook app.

September 24th, 2008

Yesterday I spent a wonderful time at MTV Latam Office in Puerto Madero (Buenos Aires, Argentina). I was just helping to get a widget built by them working on a facebook app.

Very nice people, and very nice chair too!! :)

So you can see the app here:

http://apps.facebook.com/premiosmtv/

You can vote there your favorite artists! cheers!

Matias Paterlini

paterlinimatias Development, Facebook, Open Social, Social Network , , , , , ,

Facebook Apps Development and Monetization Conference at Fasta University

September 16th, 2008

I wanted to share with you that I’ve been invited to make a presentation about Facebook apps development and monetization in the Fasta University Workshop.

The conference will be about Facebook Movement, what is it and how to be part of it, facebook api, libraries, applications infrastructure, monetization, gifts, ads and some other topics.

So if you’re close to Mar del plata, it will be on Friday 09/26 at 21:00 hs. 

Cheers!

Matias Paterlini

paterlinimatias Development, Facebook, Social Network , , , , , , , , ,