Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Facebook's Apps II part

1,735 views

Published on

  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/icOF7 ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Facebook's Apps II part

  1. 1. DESARROLLO DE APLICACIONES<br />
  2. 2. API<br />XFBML<br />Graph<br />FQL<br />
  3. 3. FQL<br />http://developers.facebook.com/docs/reference/fql/<br />http://developers.facebook.com/docs/reference/rest/fql.query<br />
  4. 4. FQL Tables<br />metrics<br />note<br />page<br />page_admin<br />page_fan<br />permissions<br />photo<br />photo_tag<br />profile<br />standard_user_info<br />status<br />stream<br />stream_filter<br />user<br />album<br />comment<br />cookies<br />connection<br />event<br />event_member<br />friend<br />friend_request<br />friendlist<br />friendlist_member<br />group<br />group_member<br />link<br />
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9. ALGUNOS MÉTODOS ÚTILES<br />
  10. 10. Extraer 10 nombres de mis amigos<br />SELECT uid2 fromfriendwhere uid1= MI_UID ORDER BY rand() LIMIT 10<br />Extraer mi fecha de cumpleaños y dónde vivo<br />SELECT concat(first_name," ","cumpleanios en ",birthday," y vive en ",hometown_location.city) from user where uid=MI_UID<br />Extraer la fecha de cumpleaños y lugar dónde viven 5 amigos<br />SELECT concat(first_name," ","cumpleanios en ",birthday," y vive en ",hometown_location.city) from user where uid in (SELECT uid2 fromfriendwhere uid1= MI_UID ORDER BY rand() LIMIT 5)<br />
  11. 11. Extraer nombres de los grupos a los que pertenezco<br />SELECT name FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid = MI_UID)<br />Extraer los nombres de mis amigos que cumplen anios hoy<br />SELECT name FROM user WHERE strpos(birthday, “MES DIA") = 0 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = MI_UID)<br />
  12. 12. Realizar los Siguientes QUERYS<br />1.-Extraer los nombres de los gruposquetucompartes con un amigo(aleatorio)<br />2.- Extraer los nombres de los amigos quesuscumples son hoy y tienen 22 anios<br />
  13. 13. Respuesta de QUERYS<br />1.-Extraer los nombres de los gruposquetucompartes con un amigo(aleatorio)<br />SELECT name <br /> FROM group <br /> WHERE gid IN ( SELECT gid<br /> FROM group_member<br /> WHERE uid=MI_UID <br /> AND <br />gid IN (SELECT gid<br /> FROM group_member<br /> WHERE uid in (SELECT uid2 fromfriendwhere uid1= MI_UID ORDER BY rand() LIMIT 1)))<br />
  14. 14. Respuesta de QUERYS<br />2.- Extraer los nombres de los amigos quesuscumples son hoy y tienen 22 anios:<br />SELECT name FROM user WHERE strpos(birthday, “MES DIA, ANIO") = 0 AND uid IN (SELECT uid2 FROM friend WHERE uid1 =MI_UID)<br />
  15. 15. Graph Api<br />http://developers.facebook.com/docs/api<br />
  16. 16. Graph Api<br />
  17. 17. XFBML<br />http://wiki.developers.facebook.com/index.php/XFBML<br />http://developers.facebook.com/docs/reference/fbml/<br />
  18. 18. Rendering XFBML<br />In order for the user's browser to correctly recognize XFBML tags, you need to specify that the page is in XHTML. Within the <html> tag, add this attribute:<br />
  19. 19. Rendering XFBML<br />In each file, you need to refer to the Facebook JavaScript Feature Loader file, FeatureLoader.js.php. This will allow your site access to all of the features of Facebook Connect in JavaScript, like XFBML, JavaScript API calls, and so forth. This script should be referenced in the BODY of your file, not in the HEAD (for the best performance, put this code right after the <body> tag in the file.).<br /><script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script><br />
  20. 20. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><br /> </head><br /><body><br /><script type="text/javascript" <br />src="http://connect.facebook.net/en_US/all.js"><br /></script><br /><script type="text/javascript"><br />FB.init({<br />appIdMyAppId,<br /> status : true, // check login status<br /> cookie : true, // enable cookies to allow the server to access the session<br />xfbml : true // parse XFBML<br /> });<br /></script><br /></body><br /></html><br />

×