Mail & Guardian Online
THE SMART NEWS SOURCE | Feb 10 2010 07:45 | LAST UPDATED Feb 10 2010 07:45
Headlines for your site

Do-it-yourself news headline feeds

Mail & Guardian Online offers external feeds of its content in two formats, XML/RSS and javascript. The javascript feeds are easy to use by simply cutting & pasting the code below onto your web page. The XML feeds are more complicated to use, but can be more powerful.

1. Javascript feeds

Get free, automatic news headline feeds for your website from Africa's top news source, the Mail & Guardian Online. It is a simple and easy process and you can do it yourself by simply cutting and pasting elements of code onto your webpage. The feeds are updated and changed throughout the day, seven days a week, 365 days a year.

Step 1.
Choose one or more of the feeds you want below. Then cut and paste the following pieces of code (below) into the HTML body of your web page in the desired location and the feed will appear. You will need to apply your own formatting and stylesheets to match the style and fonts of your website:


A. General feed (Six breaking news headlines from South Africa, Africa and around the world, including two sport headlines).

<script src="http://www.mg.co.za/feeds/legacy/freenews.aspx"></script>



B. National/local feed (Six breaking news headlines from South Africa only).

<script src="http://www.mg.co.za/feeds/js.aspx?inc=a|11|5"></script>



C. Africa feed (Five breaking news headlines from Africa).

<script src="http://www.mg.co.za/feeds/js.aspx?inc=a|37|5"></script>



D. Business feed (Five breaking news business headlines).

<script src="http://www.mg.co.za/feeds/js.aspx?inc=a|12|5"></script>



E. Sport feed (Five breaking news sport headlines).

<script src="http://www.mg.co.za/feeds/js.aspx?inc=a|18|5"></script>



F. International feed (Five breaking news international headlines).

<script src="http://www.mg.co.za/feeds/js.aspx?inc=a|13|5"></script>


Step 2.
By cutting and pasting one or more of the pieces of code above, your feed should look similar to this (in the case of Feed A, the general feed), below, bar the colour and formatting changes you make to it:



Step 3.
You can adjust the amount of headlines your javascript feed shows by adjusting the last number that appears in the code URL. For example:


5 headlines: ...script src="http://www.mg.co.za/feeds/js.aspx?inc=a|13|5...



10 headlines: ..script src="http://www.mg.co.za/feeds/js.aspx?inc=a|13|10...



18 headlines: ...script src="http://www.mg.co.za/feeds/js.aspx?inc=a|13|18...



2. XML/RSS feed


Our breaking news RSS feed delivers about 50+ news stories daily (and about 10-15 stories per day on weekends). You can get the full, general feed which contains all our news, or choose specific channels such as sport, national or business news, depending on your preference.


General RSS feed (All areas)

National/local news RSS

Sport news RSS

Business news RSS

International news RSS

Africa news RSS

And in other news/offbeat news RSS




Click to add M&G Online's RSS feed to your Google Homepage or RSS Reader


Kalahari.net
2,3-million titles to choose from.
iPod nano 16GB - Black, Was R2,499.00 Now R2,299.00! Save R200!
46 000 DVDs and Blu-Ray on sale now!
100s of new releases now in stock. Get the new Sade & Bon Jovi albums.
Widest toy range and unbeatable prices!




Follow the Mail & Guardian on Twitter!


Direct message us on our mailandguardian account to chat to the M&G Online team.
THIS WEEK'S PAPER

Advertisements


Advertising links