Monday, April 28, 2008
Saturday, April 19, 2008
Make a Yahoo Pipe and publish it using PHP
I really enjoy playing with the web and all the social tools. There is something that is quiet well advanced called Yahoo! Pipes. With Yahoo!Pipes you can reuse contents on the web and republish it in another form without programming.
Look at the following. The following Pipe allows me to collect 4 feeds (different places where you can comment my posts) and republish it as once.
To do that you drag & drop :
- 4 "Fetch Feed" Sources : you have to give the URL of the rss feed
- the "Union" Operator it merges the 4 feeds into 1
- the "Sort" Operator which allows to sort the new feed - by date descending for instance.
You can see the result of this Pipe here : Comments
There are much more drag&drops you can do. Check it out on Yahoo! Pipes by creating a new pipe.
I personnaly use the PHP feature. The result can be streamed as a php array.
Here is the code I use to exploit my Yahoo! Pipe (download it here):
1 <!-- get comments via Yahoo Pipes -->
2
3 <?php
4
5 // Pipes Request
6 $req = 'http://pipes.yahoo.com/pipes/pipe.run?_id=YEJ5xyMG3RGadogljknRlg&_render=php';
7
8 // Make the request
9 $phpserialized = file_get_contents($req);
10
11 // Parse the serialized response
12 $phparray = unserialize($phpserialized);
13
14
15 echo "<table width=120 border=1>";
16 //Loop through all items of the feed
17 foreach ($phparray['value']['items'] as $item) {
18 //For all items :
19
20 //create a new table row
21 echo "<tr><td><div style=\"width:100%; overflow:hidden\"><small>";
22 echo "On ";
23
24 //print the day it was published
25 print_r($item['y:published']['day']);
26 echo "/";
27
28 //print the month it was published
29 print_r($item['y:published']['month']);
30 echo "/";
31
32 //print the year it was published
33 print_r($item['y:published']['year']);
34 echo ", ";
35
36 //print who wrote the item (it's a comment in my case
37 $name = $item['author']['name'];
38 echo "<b>";
39 //some more checks because sometimes the author is in its own tag
40 if (strlen($name)==1) print_r($item['author']);
41 else print_r($item['author']['name']);
42
43 echo "</b>";
44
45 echo " commented: ";
46 //write the description ofthe item within its link
47 echo "<a href=\"".$link."\">".$item['title']."</a>";
48 echo ":<br/>";
49
50
51 echo "</small></div></td></tr>";
52 //end of the row for this item
53
54 }//end of for each items
55
56 echo "</table>";
Look at the following. The following Pipe allows me to collect 4 feeds (different places where you can comment my posts) and republish it as once.
To do that you drag & drop :
- 4 "Fetch Feed" Sources : you have to give the URL of the rss feed
- the "Union" Operator it merges the 4 feeds into 1
- the "Sort" Operator which allows to sort the new feed - by date descending for instance.
You can see the result of this Pipe here : Comments
There are much more drag&drops you can do. Check it out on Yahoo! Pipes by creating a new pipe.
After that what you want to exploit your new feed, you can burn it or obtain it as a bagde...
I personnaly use the PHP feature. The result can be streamed as a php array.
Here is the code I use to exploit my Yahoo! Pipe (download it here):
1 <!-- get comments via Yahoo Pipes -->
2
3 <?php
4
5 // Pipes Request
6 $req = 'http://pipes.yahoo.com/pipes/pipe.run?_id=YEJ5xyMG3RGadogljknRlg&_render=php';
7
8 // Make the request
9 $phpserialized = file_get_contents($req);
10
11 // Parse the serialized response
12 $phparray = unserialize($phpserialized);
13
14
15 echo "<table width=120 border=1>";
16 //Loop through all items of the feed
17 foreach ($phparray['value']['items'] as $item) {
18 //For all items :
19
20 //create a new table row
21 echo "<tr><td><div style=\"width:100%; overflow:hidden\"><small>";
22 echo "On ";
23
24 //print the day it was published
25 print_r($item['y:published']['day']);
26 echo "/";
27
28 //print the month it was published
29 print_r($item['y:published']['month']);
30 echo "/";
31
32 //print the year it was published
33 print_r($item['y:published']['year']);
34 echo ", ";
35
36 //print who wrote the item (it's a comment in my case
37 $name = $item['author']['name'];
38 echo "<b>";
39 //some more checks because sometimes the author is in its own tag
40 if (strlen($name)==1) print_r($item['author']);
41 else print_r($item['author']['name']);
42
43 echo "</b>";
44
45 echo " commented: ";
46 //write the description ofthe item within its link
47 echo "<a href=\"".$link."\">".$item['title']."</a>";
48 echo ":<br/>";
49
50
51 echo "</small></div></td></tr>";
52 //end of the row for this item
53
54 }//end of for each items
55
56 echo "</table>";
Friday, April 18, 2008
Citation - un peu de psychologie
"Un psychotique, c'est quelqu'un qui croit dur comme fer que 2 et 2 font 5, et qui en est pleinement satisfait.
Un névrosé, c'est quelqu'un qui sait pertinemment que 2 et 2 font 4, et ça le rend malade !"
Pierre Desproges
Un névrosé, c'est quelqu'un qui sait pertinemment que 2 et 2 font 4, et ça le rend malade !"
Pierre Desproges
Monday, April 14, 2008
Help me complete my JoHari test
I was today in a "Personal Improvement" course. During the course we learned about the JoHari window. It's a model that allows you to become more open by better stating your expectations towards someone else (openess) and by requesting feedback (self-knowledge).
See here : http://kevan.org/johari
A test is available, but for this test, you need to compare what you think of yourself with what I think of myself.
If you want to help me do the test, just drop me an email and I'll give your the link to my own JoHari window.
In return, I will do the test for you, if you wish.
See here : http://kevan.org/johari
A test is available, but for this test, you need to compare what you think of yourself with what I think of myself.
If you want to help me do the test, just drop me an email and I'll give your the link to my own JoHari window.
In return, I will do the test for you, if you wish.
Sunday, April 13, 2008
Lettre d'une vielle dame a sa banque
Malgré la mauvaise nouvelle de la semaine passée essayons de garder le sourire avec cette blague : Lettre d'une Vieille Dame a sa Banque.
Tuesday, April 8, 2008
Very sad day
Today my ex-brother in law Olivier Mailleux (38) passed away due the consequences of his cancer.
As a real Engineer, he loved the power of 2. He died on 2008 04 08...
It's a huge loss for all the people who loved him as he was... and I'm one of them. :'-(
As a real Engineer, he loved the power of 2. He died on 2008 04 08...
It's a huge loss for all the people who loved him as he was... and I'm one of them. :'-(
Subscribe to:
Posts (Atom)
-
Quand j'étais à l'école j'étais souvent puni (hé oui!). Une des punitions était de recopier 5 ou 10 verbes du Bescherelle. J...
-
Link: http://www.nlb.gov.sg/Corporate.portal;jsessionid=RD3yRpTJC17nnd0zGRyz8yz4NqFynZvhZQGkhHSrVBlRFlBTF0nz!-1128162146?_nfpb=true&_pag...
-
http://thmstreet.com/dev4/testResp.php