Using AfricaNewsSearch’s Advance options

December 2nd, 2009 No comments

We’ve explained how to access our content using an HTML link, HTML choicesframes, JavaScript, PHP, and RSS. When you use these methods, you get the option of specifying parameters that determine what news you receive from our server and the format of the news. Below, we’ll briefly mention some of the arguments you can use. Note that not all parameters are available for all of the different ways you can access our content. In addition, although most arguments may be combined, some cannot be.  

A. Specify number of articles to return

By default, AfricaNewsSearch’s getnews program (getnews3) displays 10 articles. These articles are selected based on ranking (relative importance of the article) and publication date. To change the number of articles to display, add the parameter tot when you call the getnews3 script. For example, request 20 articles like this:

http://www.africanewssearch.com/getnews3.php?tot=20

Or 3 articles:

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 will open in a new window. To specify that the results open in the same window pass the lnkw variable with a value of 1. 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 this option are listed 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. Both examples 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 for available news categories are listed below. Note that the codes are case sensitive. An example of how to use category options is provided below.  

[Category]                                [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 request 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 images displayed use the following code.

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

 

Free news using our RSS Feed

November 25th, 2009 No comments

As some of you probably already know, our news service is available via RSS feed. You can access this feed using the rdf function when you call the getnews script. Here is an example:

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

The advantage of an RSS feed is that it provides tagged content for each article (source, link, title, etc.) that you can use. If desired, you can reformat and display the information on your website using the tags. 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. For example, here is how you request 15 stories:

http://www.africanewssearch.com/getnews3.php?tot=15&rdf=1

Alternatively, you may request 20 stories on West Africa like this:

http://www.africanewssearch.com/getnews3.php?rdf=1&tot=20&rgn=WA

These advance options (tot, rgn, etc.) will be the subject of a future post.

Note that you may use the following links to add Africa News to the popular aggregators below:

add-to-google-plus addtomyyahoo4 ngsub2 sub_modern5

Recommendation: A sister blog

November 20th, 2009 No comments

blogSome of you may be interested in our sister blog the FindAfrica Blog. While this blog (that is, the one you are currently reading) is dedicated to providing information about new features on AfricaNewsSearch.com and explanations of how to use those new features, the FindAfrica Blog focuses on publishing Africa and Africa related content such as commentaries and editorial on the goings on in Africa. We recommend the FindAfrica Blog to all our users as it is a sister site with content of much interest.

Categories: Admin Tags:

Free news for your website using PHP

November 19th, 2009 No comments

PHP is versatile programming language. It is a great tool for making dynamic web content. Other advantages of PHP include:php

  • A huge user base (so you can get help)
  • Lots and lots of tutorials
  • Easy connectivity with databases, especially the very popular MySQL
  • Free

If the server on which your website is hosted supports PHP, you should seriously consider using it. For an example of a site that integrates AfricaNewsSearch content into their site using PHP click HERE. Note that compared to the JavaScript service, the PHP service is better only to the degree that you want to use advance options like specifying the number of articles to display or limiting the news you receive to particular regions, country or by category (business, sports, etc). We will discuss using advance options in a future post. If you can wait, look 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”)
; ?>

In a future post, we’ll discuss how to customize content you get back from the service. Again, look here if you can’t wait.

New Feature: Popular news

November 18th, 2009 No comments

newsToday, we added a new feature for our users on AfricaNewsSearch.com. This feature, which displays popular news stories of the day, has been added to the story pages. The story page is the page you see when you click on a story. Test it out AfricaNewsSearch.com.

This feature represents a continuation of our goal to present users with comprehensive, relevant Africa news. We expect that this feature will be very helpful to users as it will enable them to access our online Africa news more efficiently.

Free news for your website using JavaScript

November 16th, 2009 No comments

Like HTML Frames, JavaScript is not as popular as it once was. However JavaScript remains much more popular than Frames and can serve as a javascriptvery reliable means of powering your website. Indeed, using our JavaScript service, you can add great, reliable and current Africa and African related news to your website with minimal hassle. Best of all, you can totally customize this content to match the look and feel of your website. This make our Javascript service a much better option than Frames.

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’ browsers support JavaScript (virtually all browsers support JavaScript, although some users may have it disabled). Our JavaScript service is generally a better choice compared to HTML Frames. However, HTML Frames may be preferred to JavaScript if your site already uses frames.

We have two options for JavaScript:
Simple news feed – This option displays text with minor formatting  <SAMPLE>. The formatting is provided by the page in which the script is added. In other words, it should look like the page you put the feed on.
Formatted news feed – This option displays formatted news with or without news summaries. You get to format the feed <SAMPLE>.javascript2

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

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

<script 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 showing the AfricaNewsSearch content you are missing.
</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 more than 25 articles, consider using PHP or XML.javascript3

JavaScript: Formatted News Feed:
Here is the sample code for displaying news content on your site using our 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 script 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).

Good luck and let us know if you have questions. These JavaScript services are a great way to add content to your website.

Free news for your website using HTML frames

November 15th, 2009 No comments

HTML frames are not as popular as they once were. In its hay day, many html frameswebsites used frames. Frames were (and for some, still are) a great way to organize content. In addition, frames allowed webmasters to link and incorporate content into their website.

Alas, those were the good old days. Now, with programming languages and design tools of all tastes and flavors, most webmasters superior alternatives for website design.

However, we here at AfricaNewsSearch.com are keeping the dream alive. Of course, we encourage you to take advantage of the other services we provide such as our PHP option. Indeed we will discuss using a programming language, such as PHP, to display our news on your site in a future post. If you can’t wait, we encourage you to go here.

For now though, this is what you do if you want to add our news to your site using frames. Some of this is taken from here.

You may include AfricaNewsSearch content in your page using Standard Frames or Inline Frames. Below is a sample using inline frames. The result htmlfrom this code is similar to using a scripting language to combine content from multiple websites. See it in action here. However, keep in kind that scripting languages provide better integration. We recommend you consider using JavaScript if you are considering frames.

To use IFrames, simply add the code below or some code like it 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. See a standard frame sample here. The code for this simple is as follows:

<FRAMESET ROWS=”*,1″ border=0>

< FRAMESET rows=”70,*”>

<frame src=”http://www.africanewssearch.com/top.html” border=0 noresize scrolling=no>

< FRAMESET cols=”*,*”>

<frame src=”http://www.africanewssearch.com/getnews3.php” name=”sideAD” noresize>

<frame src=”http://www.africasearch.net/” name=”sideAC” noresize>

<NOFRAMES>

<BODY>

<P><I>This document requires a browser that can view frames.</i></p>

</BODY>

</ NOFRAMES >

</ FRAMESET >

</ FRAMESET >

Here, we have 3 windows. The first window shows the top banner. It is defined as having 70 rows. The page used in that first window is linked by the url http://www.africanewssearch.com/top.html. Next, we split the remaining display area in half vertically. On the left we display html frames2AfricaNewsSearch news and on the right we have another page. Here, we simply linked to africasearch.net. As you can imagine, that link on the right could have been a link to any content on your own server or on another website, as we’ve done here. Learn more about using frames here, here, here and here.
If you encounter any problems, please contact us here or respond below.

New Service: News by country

November 15th, 2009 No comments

We have started a new service that provides news by country to individual users and website owners who use our getnews service. This addition to our portfolio of services expands what is already one of the largest sources for Africa and Africa-related news on the internet.

Users can access this new service by navigating to the country page or from the menu on our main page. Webmasters can take advantage of this resource by adding it to the getnews call. For example, a webmaster might use one of the urls below for news from South Africa.

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

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

Free news for your website via a link

November 13th, 2009 No comments

As many of you know, you can use our news on your website. There are many options for adding our news to your website. The options include everything from adding a single HTML link to PHP scripts and other forms of web programming. Detail explanations for several of these approaches can be found on our “get news” page. html

In this post, I will show how easy it is to get our news using a simple HTML link. This, by the way, is the easiest way to get our news. Basically, all you have to do is link to http://www.africanewssearch.com/getnews3.php. That’s it! Although this does not do so, some of the other methods for adding our news to your site will actually pull the news and display it on your site. Look for future postings where we explain some of these other methods or head over to our “get news” page.

By the way, we recommend 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.

Hello and welcome

November 12th, 2009 No comments

Welcome to our blog. We plan to use this blog as a means of communicating valuable information to users of our site. We encourage you to visit often as we intent to provide a wealth of information on these pages.

Thanks,

Mark

Categories: Admin Tags: , ,