!!! Listings zum Artikel "Das eigene Gesicht"
!!! von Ramon Wartala in iX 4/2008, S. 78
!!! Listing 1: Hello World
1 require_login();
13 ?>
14
15 Hallo iX-Leser und herzlich willkommen bei
17 Ihrer ersten Facebook-Applikation!
!!! Listing 2: Liste aller Freunde mit Bildern
1 $fb_friends = $facebook->api_client->friends_get();
2 echo "
\n";
3 echo "
Liste meiner Freunde:
\n";
4 foreach ($fb_friends as $friend) {
5 $photo = $facebook->api_client->users_getInfo($friend, 'pic');
6 echo "
";
7 echo "
\n";
8 }
9 echo "
\n";
!!! Listing 3: Feedreader der iX-News innerhalb des Facebook-Canvas
1 require_login();
15
16 $feed = 'http://www.heise.de/ix/news/news-atom.xml';
17 $rss = @fetch_rss($feed);
18 echo "\n";
19 echo "
\n";
20 echo "
\n";
21
22 foreach ($rss->items as $item ) {
23 echo "";
24 $title = $item["title"];
25 $url = $item["id"];
26 $updated = $item["updated"];
27 $summary = $item["summary"];
28 echo "
".$title."
\n";
29 echo "
".$updated."
\n";
30 echo "
\n";
31
32 }
33 ?>