
You want to build a page about someone like Barack Obama or Steve Jobs or some organization like Google or NBA.
Topics are pre-defined people, organizations, places, diseases, issues, events and products in the daylife eco-system.
Things you can put on a topic page:
Read more below to see the code (in PHP) that builds this page.
The Batch API lets you make multiple DayPI requests as one request to the daylife servers.
You can use this PHP client to make a Batch.parallel request. You can download this script from the attachment below.
Here is sample code how to use this script to first form your DayPI requests and then provide them as request to the Batch API:
I have written a PHP script that generates RSS feeds for articles by calling Daylife's search APIs for any topic, queries, tags or events happening in the world.
Each item in the RSS feeds contains an article headline, description, published time and link to the original source of the article. To produce a desired RSS feed of your interest, you can use the script that I have hosted by forming a URL that looks like:
http://www.buzzingblog.com/dayliferss/rss.php?query=<search term of your choice>
For e.g.,
http://www.buzzingblog.com/dayliferss/feed.php?query=Barack%20Obama
Read more about Daylife's Search query syntax to form your queries intelligently.
http://www.buzzingblog.com/dayliferss/feed.php?query=Barack%20Obama&limit=20
With the availability of RSS feeds on top of the Daylife API, opportunities to build news applications are endless. The script calls the Daylife API on every request and builds the RSS feed in real time. Webmasters can use RSS generator to produce feeds on desired topics to feed them their Drupal/Joomla or any other RSS supported content management systems.
You can download the script and run it on your own server, in case, you want to customize it. You will need to substitute your own accesskey and shared secret that you received from Daylife to make the script work.
Indexes help you create fun widgets to keep track of the coverage that topics of your interest are getting. The Index Creator in our labs section helps your create an index widget in few minutes with upto 12 topics/queries that you care about.
However, if you want an index widget with more customizations, you can use our News Indexer code to generate the data files for such a widget. Some examples of these customizations could be a an index with
Remember, this code lets you generate the XML data files for an index widget. You will have to then build the UI for the widget that consumes this XML.
Drupal is one of the most popular content management systems along with Wordpress and Joomla.
This basic DayPI drupal module lets you create a block with headlines about any topic you want. You can also host a search page that lets any user to search news from around the web on your website.
The Communication Initiative (The CI) network is an online space for sharing the experiences of, and building bridges between, the people and organisations engaged in or supporting communication as a fundamental strategy for economic and social development and change. They use this drupal module to present recent news about areas of their interest in the right navigation bar of their site.
The PHP sample below provides a sample client library to consume the daylife APIs. We have demonstrated integration with a single API call - search_getRelatedArticles.
The code below provides hooks to receive json encoded response objects from the daylife API. It does NOT use the XML encoded response.
The sample below shows how to render a set of headlines matching a hard coded search term.
This news indexer sample is what we use to power the indexer widgets for Treehugger and CNN's Meme-o-meter
This php sample demonstrates how you can make daypi calls to get stories, images, quotes and connections for a given topic name or a topic id.