09
Sep

The new Graph API presents a very easy approach to get user’s data and connections in the Facebook graph. But some developers experienced a flaw that drives them crazy (myself as well) – this is the case when some results are returned translated to the user’s language – for me this is Bulgarian. To avoid this often undesirable behaviour by using the latest PHP library Facebook has provided us – just add one more header in the curl options (CURLOPT_HTTPHEADER) – ‘Accept-Language: en-us,en;’. This will  force the response to be returned in the desired langugage – just change the ‘en-us,en’ part to get response in any other desired language.

Hope this saves time for you.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Ma.gnolia
  • NewsVine
  • Print
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

17
Jun

Facebook has exposed a simple way for the users to add an application tab to Facebook business pages and it is up to the decision of the developers if they will use this page. As you know – the simplest link to add an application is http://www.facebook.com/add.php?api_key={APPLICATION_API_KEY}, and to access this simple page – load this link: http://www.facebook.com/add.php?api_key={APPLICATION_API_KEY}&pages=1
This will work only if you have set the application to be available to Facebook pages –  via checking a checkbox in the Authentication tab in the Facebook Developer application (link: http://www.facebook.com/developers/editapp.php?app_id={APPLICATION_ID})

Here is a simple preview of the canvas (under the regular Facebook frame):

Page for adding Facebook application tab to business page

Here are

  1. Your application icon
  2. Your application name
  3. List of business pages to which the user is administrator

That’s all folks.
Hope this helps anybody.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Ma.gnolia
  • NewsVine
  • Print
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

31
May

Over the past year Google’s Chrome browser has made a solid progress and has a good and improving standing between all browsers. Some of the best features he offers are – sleak interface with nice home page, which can be easily modified by Themes, Virtual machine for faster JavaScript execution, support for HTML5, interface for Extensions, easy to setup synchronization of the bookmarks with your google account; and more specifically for web developersTask manager and JavaScript&Developer tools. You can even add more advantages that Chrome browser has in hand but let’s stop here. Most of the listed things here are also supported by other browsers so why do Google even bother to create a new browser? They have tried to explain it here but my point is that with the format of the extensions they offer working with Chrome is like a child game. As a web developer i need many tools to assess my work by means of load time. Also important is the way i communicate and manage my tasks. So i’ll give you the list of the Chrome extensions i’m using the most:

And here are some less usefull but also do a good work:

I hope this lists give you some thoughts about how to organize better your work with Chrome browser for web development.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Ma.gnolia
  • NewsVine
  • Print
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

, , ,

11
May

Publishing user actions to their wall is one of the basic functionalities that make one application viral in the Facebook world. So i’ll present here a simple method for dynamic retrieval of feed data. My example includes FBML, JavaScript, FBJS, PHP.

 

Quick links: FB FeedFBJS AJAX, Feed Template Console

 

Instead of storing the feed data for every action that the user can publish to his wall we can create interface (in php file) for retreaving the feed data. First in the FBML of the application we have to define our JavaScript function:

in index.php:

function toWall(feed_id, feed_url){
	var toWalldialog = new Dialog();
	var ajax = new Ajax();
	ajax.responseType = Ajax.JSON;
	ajax.requireLogin = true;
	ajax.ondone = function(data){
		toWalldialog.hide();
		Facebook.showFeedDialog(feed_id, data);
	};
	toWalldialog.showMessage("Loading feed data", loading_image);
	ajax.post(feed_url);
}

I’m using here in this function a predefined variable loading_image, for which Facebook takes care:

in index.php:

<fb:js-string var="loading_image">
  <p style="text-align:center;">
    <img src="http://daniel-zahariev.info/img/indicator.gif" alt="" />
  </p>
</fb:js-string>

 

Then we have to call it:

in index.php:

 

<a onclick="toWall(feed_id, 'link-to/interface.php'); return false;" href="#">publish to wall</a>

In the php file we can have something like this:

in interface.php:

<?php
include "facebook.php";
$feed_data = array("set here the value of all keys that you should provide to the registered feed");
echo jdon_encode($feed_data);
?>

 

It is fairly simple method to make your FBML output lighter and this way you make your application faster.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Ma.gnolia
  • NewsVine
  • Print
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

,

10
May

Recently Google launched Google Analytics Data Export API which allows developers to connect to a Google profile and

download Analytics data in the form of Google Data API feeds

I was interested and i started a search and i found that this guy – Chris Hope has already done a series of small PHP tutorials on this topic. I have some ideas and i may start writing my own PHP interface for this new Google API.

Stay tuned :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Ma.gnolia
  • NewsVine
  • Print
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

, , ,

Tools

Daniel Zahariev Daniel Zahariev is Senior Web Developer with extensive knowledge on PHP(Zend Framework), MySQL, XML, XHTML, CSS, JavaScript (jQuery&Prototype)

 

Tools

Notepad++