Africa News Search Logo


HOME

About

Discussion Forum

How to include news via a link

How to include news in a page
-HTML Frames
-JavaScript
-Java Applets

Advance
-PHP
-PERL

RSS Feed (RSS/XML/RDF Format)

Terms & Conditions

Register for Updates

Link to us
Get free news for your website

About

You may now add updated African news to you website. These news headlines are updated continuously throughout the day and served from our server. Updates are now made as news stories become available. This allows AfricaNewsSearch to search as a source of current news from around Africa.

Adding news links to your site will increase your page views and encourage users to return to your site. You may add AfricaNewsSearch news via one of several methods that we have developed. We currently have options to add AfricaNewsSearch using the following:


You must read the "Terms & Conditions" below before adding links. You are also encouraged to register to receive updates and other information. We ask that after adding our content, you provide a link to our site from your site. Click here for information about linking to AfricaNewsSearch.

Discussion Forum
Make sure you visit our discussion forum for up-to-date information, tips/suggestions, questions, files and more. In the forums you may pose questions, get help on scripts or other tools you can use to better integrate AfricaNewsSearch news into your website and more. Discussion Forums

The following sections take you through the various options for adding FREE news content to your web site. Keep in mind that the easies options to implement are the least flexible.

How to include news via a link <SAMPLE>
One option for adding news to your website is to add a link to AfricaNewsSearch. A link may be added by simply placing a link to AfricaNewsSearch on your site.
To add  news via a link, simply add this HTML code below to your site.

http://www.africanewssearch.com/getnews3.php

See the Advance section below for information about how to customize the result displayed by AfricaNewsSearch when you add this link. It is recommended that you add an image to the link so as to increase visibility and help your users identify the resource. If you'd like to add an official AfricaNewsSearch image, click here. Alternatively, you may create your own image.


How to include news in a page
AfricaNewsSearch news may be added to a page either using HTML Frames or a Scripting language. While an HTML Frame page actually consist of multiple pages displayed in the browser, a scripting language can be used to create and display a single page that incorporates news from AfricaNewsSearch. In either case, the visitor to your sites get updated news in one browser window.

Scripting
To add news from AfricaNewsSearch in a custom page, you’ll need to use a scripting language such as PHP (JavaScript, VBScript, Python, Curl, Perl, etc). Click here for information about PHP. Note that your web site will need to support PHP (or whichever scripting language you are using) or you will be unable to use this option. If your website does not support a scripting language, consider using JavaScript, Java Applets and frames discussed below. Note that we provide sample code (below) for PHP,  JavaScript, Java Applets, and Frames. JavaScript may provide better integration with your site compared to frames.

If you do have scripting capabilities and are comfortable with web programming languages, you should consider using the RSS feed (XML option) described below. This option provides the most flexibility. However, it also requires the most experience and knowledge of web programming and/or scripting.
Here is the code you'll need to add the news to your website using PHP
<?PHP  $fp = readfile("http://www.africanewssearch.com/getnews3.php")
; ?>

IMPORTANT: Your website will need to support PHP to use this PHP option. If your site does not support PHP, you will need to use a supported scripting language, JavaScript or HTML Frames discussed below.

Frames <SAMPLE> <SAMPLE>
You may include AfricaNewsSearch news in a page using Standard Frames or Inline Frames. Below is a sample using inline frames. The result from this code is similar to using a scripting language. However, scripting languages provide better integration. We recommend you consider using JavaScript to Frames if it better integrates with your website. Ultimately, how the option integrates with your site should determine which option you use.

To use Frames, simply add the code below to any web page.

  <IFRAME src="http://www.africanewssearch.com/getnews3.php" width="100%" height="100%"
           scrolling="auto"   frameborder="0">
  [Your user agent does not support frames or is currently configured
  not to display frames. However, you may visit
  <A href="http://www.africanewssearch.com/getnews3.php">the related document.</a>]
  </iframe>

 Here is what the above code mean:
  src="http://www.africanewssearch.com/getnews3.php" - the source of the content for the frame.
  width="100%" height="100%"  - set the width and height of the content
  frameborder="0"  - do not show a border

Alternatively, you may use standard frames. Click here for information about Frames and Inline Frames.
If you encounter any problems, please contact us here.

JavaScript
You may include AfricaNewsSearch news in a page using JavaScript. Unlike PHP and other server-side scripting languages, JavaScript is a client-side scripting language. This means that even if your website does not support scripting, you can use JavaScript when your users support JavaScript (Virtually all browsers support JavaScript). Note that depending on your site, JavaScript may present a better option compared to HTML Frames. HTML Frames may be preferred if your site already uses frames.

There are two options for JavaScript:
   Text news feed          - This option displays text with minor formatting  <SAMPLE>. The formatting
                                       is provided by the page in which the script is added.
   Formatted news feed  - This option displays formatted news with or without news
                                        summaries <SAMPLE>.

JavaScript - Text News Feed:
Here is the sample code for displaying news content on your site using the JavaScript Text News Feed option. Click <HERE> to see the result.

<script language="JavaScript">
var cnt  = 12;
</script>

<script language="JavaScript" src="http://www.africanewssearch.com/news/getnews.js">
</script>

<noscript>
If you see this message, your browser is not running JavaScript.
Click <a href="http://www.africanewssearch.com/index.php"
target="_blank"> here</a> to open a new window with AfricaNewsSearch.
</noscript>

This code displays 12 headline articles. The code is in 3 parts. The first part sets the number of articles to display (var cnt = 12). The second calls the script and the third is added for browsers that do not support JavaScript. Note that you may request a maximum of 25 articles. If you want to display articles in another format or a different number of articles consider using PHP or XML.

JavaScript: Formatted News Feed:
Here is the sample code for displaying news content on your site using the JavaScript Formatted News Feed option. Click <HERE> to see the result.

<script language="JavaScript">
var count                 = 6;
var border_color     = "#cc0000";
var header_color     = "#ffccff";
var alt_color1          = "#cccccc";
var alt_color2          = "#ffcc99";
var title_text             = "Africa News";
var width                  = 125;
var border_on           = "no";  //OR "no"
</script>

<script language="JavaScript" src="http://www.africanewssearch.com/news/getnews2.js">
</script>

There are actually two scripts required to use this option. The first scrip specifies the parameters for the second script. The following parameters are defined in the first script:

border_color: The color used if a border is requested
header_color:  The color used for the header
alt_color1:       One of two possible colors used to display each story
alt_color2:       One of two possible colors used to display each story
title_text:          The text used as the title of the news feed
width:               The width of the news feed
border_on:        This parameter turns the border on or off

The second script defines the source file. There are two source files available. The first source file (http://www.africanewssearch.com/news/getnews2.js) displays news with summaries. The second source file (http://www.africanewssearch.com/news/getnews3.js) displays news without the summary (headlines only).

Java Applets
We have recently added Java Applets to our list of options. Ideally, Java Applets may be used in addition to other options discussed on this page. There are currently three applets available. These applets may be added to your site by simply copying and pasting the code for each applet. To view the applet samples and the code necessary to use the applets, click HERE.

PHP
If you server supports PHP, this may be the preferred option for adding news content to your site. For an example of a site that integrates AfricaNewsSearch content into their site using PHP click HERE.

Here is the code you'll need to add AfricaNewsSearch news to your website using PHP
<?PHP  $fp = readfile("http://www.africanewssearch.com/getnews3.php")
; ?>

See the Advance section below for information about how to customize the result displayed by AfricaNewsSearch when you add this PHP code.


PERL
Many servers support PERL. Perl is a versatile programming language that may be used to dynamically acquire updated AfricaNewsSearch news. Sample code for using PERL to add content to your site has been provided in the Discussion Forums. Click HERE.

Advance
AfricaNewsSearch provides several advance options that allows you to customize the news you receive on your web site. The options  are discussed below.

A. Specify number of articles to return
By default, AfricaNewsSearch's getnews program (getnews3) displays 10 of the latest articles. These articles are selected based on ranking (relative importance of the article) and publication date. To specify the number of articles to display, add the parameter tot when you call the getnews3 script. For example, request 20 articles as follows:
http://www.africanewssearch.com/getnews3.php?tot=20

Or 3 articles as:
http://www.africanewssearch.com/getnews3.php?tot=3

B. Get headlines online
If you would like getnews to return only headlines, pass the hdl variable with a value of 1 to the script as follows:

http://www.africanewssearch.com/getnews3.php?hdl=1

C. Specify linking option
By default, links to articles returned by getnews3 are displayed in a new window. To specify that the results be displayed in the same window pass the lnkw variable with a value of 1 to the script . For example:

http://www.africanewssearch.com/getnews3.php?lnkw=1

D. Add news search box
A news search box may be added to the results returned by getnews3. The search box may be added at the top or bottom of the news results. To add the search box at the top of the news pass the schb variable with a value of 1 to the script. Use a value of 2 to display the search box at the bottom of the  news results. You may add the search box at both the top and bottom of the news by passing a value of 3.

http://www.africanewssearch.com/getnews3.php?schb=3

E. Get regional news
You may specify regional news by passing the rgn option. The available regions and associated regional codes for use with the rgn option are presented below. An example is also presented.
Region                     Code
North Africa                NA
South Africa                SA
East Africa                 EA
West Africa                 WA
Great Lakes                 GL
Horn Of Africa              HOA


http://www.africanewssearch.com/getnews3.php?rgn=SA

F. Get news by country
You may get individual country news by passing the cty option. The value for this option should be the name of the country. Here are two examples for South Africa. In one example, the space character is converted to its HTML value. They should both work

http://www.africanewssearch.com/getnews3.php?cty=South%20Africa
http://www.africanewssearch.com/getnews3.php?cty=South Africa

G. Get news categories
You may specify news from different categories using the cat option. Codes of available news categories are listed below. Note that the codes are case sensitive. An example of how to use category options is provided below.

[Region]                    [Code]
Business News               business
Sports News                 sports
Health News                 health
Arts & Entertainment News   arts

[Example]
http://www.africanewssearch.com/getnews3.php?cat=business

H. Display news images
You may activate display of news images using the "pic" option. In addition to activating this option, you may also specify the width and height of the images using the "picW" and "picH" options. Note that all options are case sensitive. If you do not specify a width or height, the size of the images displayed will be 50px by 50px. This is the default display size. For example:

http://www.africanewssearch.com/getnews3.php?tot=15&pic=1
http://www.africanewssearch.com/getnews3.php?tot=15&pic=1&picW=100&picH=100

I. Combine options
You may specify multiple options in a call to getnews. For example, to get 15 articles from West Africa with a search box on the bottom use the following code.

http://www.africanewssearch.com/getnews3.php?tot=15&rgn=WA&schb=2


RSS Feed RSS feed - (XML/RDF format)
Add to Google Add to NewsGator Add to My Yahoo! Add to Bloglines
AfricaNewsSearch also has an RSS feed. Our RSS feed is formatted using the Resource Description Framework (RDF). To use the feed, add the parameter rdf when you call the getnews3 script. There are currently several versions of the RDF specification. We provide a version 0.9 and version 1 feed. We strongly recommend all users use the version 1.0 feed. You specify the RDF version as the value of the rdf parameter passed to getnews3. Examples are presented below. The main difference is that the version 1 provides more details than version 0.9. Also, the version 1 feed can be formatted automatically by browsers.

For RDF version 1:
http://www.africanewssearch.com/getnews3.php?rdf=1

For RDF version 0.9:
http://www.africanewssearch.com/getnews3.php?rdf=999

The advantage of an RSS feed is that it provides the tagged content for each article (source, link, title, etc.). If desired, you can reformat and display the information on your website. Alternatively, you can display the news without reformatting. If you choose to reformat and display the RSS content, you will have complete flexibility to integrate the news into you site.

Note that you my combine the rdf parameter with other advance options discussed above. For example, you may request 15 articles in RDF version 1 format as follows:
http://www.africanewssearch.com/getnews3.php?tot=15&rdf=1


Also, you may request 20 articles from West Africa in RDF version 1 as follows:
http://www.africanewssearch.com/getnews3.php?rdf=1&tot=20&rgn=WA

You may also use the following links to add Africa News to the popular aggregators below:
Add to Google Add to NewsGator Add to My Yahoo! Add to Bloglines


Terms and Conditions

Africa News Search provides this service "as-is" and at no charge to you. We specifically disclaim any and all representations or warranties, express or implied. Any site that chooses to use this service specifically acknowledges and agrees that Africa News Search is not liable for any direct, indirect, incidental, special or consequential damages that result from the use of, or the inability to use, this service.

Registering

As the owner or manager of a site, we know how important it is that you receive appropriate and updated content. We also know how important it is to be kept informed of changes or new features that you may take advantage of. To that end, we encourage you to register your site. Registration is completely optional. However, registering your site will allow us to keep you informed. Without registering, we have no way of contacting you with information, new features or additional content that you may find valuable. To register, send your site's URL and email address to us.

Contact us