How to automatically update your FeedBurner RSS using cURL
FeedBurner is a pretty cool service that provides insights and many other useful information about the RSS Feed of a website, though if you need your users to be notified immediately after a new item is posted on the website you’ll find that there is a nasty limitation in place: the feed is only updated every 30 minutes.
Fortunately FeedBurner also provides a ping service that let you manually update your RSS Feed; but visiting a website every time you need to update your feed isn’t very practical, instead we can use cURL to do this automatically every time we publish a new article or something.
Here’s the PHP code (you need to make sure that your hosting has cURL enabled):
$ch2 = curl_init(); curl_setopt($ch2, CURLOPT_URL, 'http://feedburner.google.com/fb/a/pingSubmit'); curl_setopt($ch2, CURLOPT_POST, 1); curl_setopt($ch2, CURLOPT_POSTFIELDS, 'bloglink=http://www.example.com'); $result = curl_exec($ch2); curl_close($ch2);
You need to place this right after the code that publishes a new item on your website, so that the RSS Feed is immediately updated with the new articles (or whatever you are publishing).
Another way to do this is by putting the code in a cronjob and run it every X minutes, but use this only if you can’t get the other method working, it’s way better.
Here’s the code to use cURL directly from the command line (use this if you are planning to go with the cronjob method):
curl -d 'bloglink=http://www.example.com' http://feedburner.google.com/fb/a/pingSubmit
Also you don’t need to provide the full RSS Feed URL, the website base URL will do just fine.
Di nuovo online!
Era un po’ di tempo che avevo intenzione di rimettere su il blog personale, tuttavia volevo evitare di farlo utilizzando WordPress visto che è scritto senza rispettare le più basilari regole per una programmazione corretta quantomeno sensata.
Cosa scegliere quindi? Sembra facile, ma non sono poi molti i CMS PHP creati specificamente per l’amministrazione di un blog. In attesa che Antonio sviluppi la piattarforma di blogging ideale mi sono messo alla ricerca di qualcosa che facesse al mio caso e, dopo essermi imbattuto in cessi intervallati da CMS aggiornati al 2005, pensavo di averlo trovato: Serendipity.
Beh inutile dire che è stato un gigantesco FAIL: dopo averci perso una giornata a preparare il tutto, installare i plugin necessari (ne servono un po’ dato che le funzioni “out of the box” sono davvero basilari), modificare un po’ il tema, ed altre cosucce; vado finalmente a spostare i files nella root del sito per mettere online il tutto (avevo installato il CMS in una sottocartella per i test), modifico di conseguenza la configurazione e… puff! Non l’avessi mai fatto!
Ecco il simpatico errore apparso:
serendipity error: could not include /path/serendipity_config_local.inc.php - exiting. Please create the file yourself or check permissions
Inutile dire che il file c’era, aveva i permessi giusti, ecc. Dopo altro tempo perso tra infinite prove e googlate inutili (sembra che questo problema, una volta presentatosi, nessuno sia mai riuscito a risolverlo) ho optato per un bel “rm -r serendipity/” e ho, a malincuore, (re)installato WordPress.
Ecco, avevo bisogno di un primo post per mettere quantomeno online il tutto, pur essendo io il re dell’incostanza e il peggior nemico della grafica cercherò di lavorare al blog per renderlo decente e addirittura(!) pubblicare qualche contenuto interessante.
Menu
Cloud Tag
Categories
- Announcements (1)
- Benchmarks (2)
- How-To (5)
- News (1)
- Projects (1)
- Tips (5)
Archive
- June 2011 (1)
- May 2011 (1)
- January 2011 (1)
- October 2010 (1)
- August 2010 (4)
- July 2010 (1)



