<body>

wolfb - feeds and RSS

rss feeds, and the world of syndication

amazonRSSwriter: create Amazon RSS feeds automatically

Saturday, January 14, 2006

This is a new script that I have created just to provide easy Amazon RSS feeds on different subjects. You can try the script here. Simply enter a word or a few words and the script will return an Amazon RSS feeds with books related to the search terms.

The whole script is here:

------------------------------------------------------


<?php
/*
Project: AmazonRSSwriter: Amazon URL RSS writer
File: amazonRSSwriter.php
Author: hombrelobo <minilobo@gmail.com>
Version: 0.50

For the latest version of the writer, questions, help, comments,
etc., please visit:
http://wolfb.com/2006/01/amazonrsswriter-create-amazon-rss.html
http://wolfb.com/

What is AmazonRSSwriter ?
Sometimes is convenient to have RSS feeds of Amazon products, to
keep track of new books in a certain topic. This script uses Amazon
services to create a simple one.

You can see it in action in:
http://wolfb.com/rss/amazonrsswriter.php

Enjoy it !!

******************************************************************************
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
This work is hereby released into the Public Domain. To view a copy of
the public domain dedication, visit
http://creativecommons.org/licenses/publicdomain/ or send a letter to
Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
******************************************************************************
*/
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Amazon RSS writer</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="KEYWORDS" CONTENT="Amazon, RSS, writer">
<META NAME="DESCRIPTION" CONTENT="Amazon RSS writer, create your own feeds">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">

</head>

<body><br>

<?php

// Sends an email if the form has been submitted
if ($_POST['send'])
{

//Affiliate link code
//http://xml.amazon.com/onca/xml3?t=deustocom&dev-t=amznRss&KeywordSearch=rss&mode=books&sort=+daterank&offer=All&type=lite&page=1&f=http://xml.amazon.com/xsl/xml-rss091.xsl

$basic_link= "http://xml.amazon.com/onca/xml3?t=deustocom&dev-t=amznRss&KeywordSearch=SEARCHWORD&mode=books&sort=+daterank&amp;offer=All&type=lite&page=1&f=http://xml.amazon.com/xsl/xml-rss091.xsl";

$term=$_POST[texto];

// First we replace all the spaces with %20
$term = preg_replace('/\ \b/i', '%20',$term);

$find = '/\SEARCHWORD\b/i';

$replacement = $term;

// Now we replace the search terms in the feed.

$content = preg_replace($find, $replacement,$basic_link);

// And now we output the feed and the subscription links:


ECHO <<<END
This is the URL of your feed:<br><br>
$content<br><br>

And you can subscribe to it here:<br><br>
<a href="$content" title="Subscribe to my feed"><img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="border:0"/></a>
<a href="http://add.my.yahoo.com/rss?url=$content" title="RSS books in Amazon"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="" style="border:0"/></a>
<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=$content" title=""><img src="http://www.newsgator.com/images/ngsub1.gif" alt="Subscribe in NewsGator Online" style="border:0"/></a><br><br>
<a href="http://fusion.google.com/add?feedurl=$content"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" style="border:0" alt="Add to Google"/></a><br><br>
<a href="http://client.pluck.com/pluckit/prompt.aspx?GCID=C12286x053&a=$content"><img src="http://www.pluck.com/images/pluck/pluspluck.png"/></a><br><br>
<a href="http://www.bloglines.com/sub/$content" title="" type="application/rss+xml"><img src="http://www.bloglines.com/images/sub_modern1.gif" alt="Subscribe in Bloglines" style="border:0"/></a><br><br>
END;



}
else
{
?>



<table>
<td width="60%"align="left" valign="top">
<?php echo "Amazon RSS writer script" ?> <br><br>
<?php echo "Create your own Amazon RSS feeds easily with this script" ?> <br><br>
<?php echo "Type the search terms for the feed:" ?>
<br>

<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<p><?php echo "Term:" ?><br>
<textarea rows="1" name="texto" cols="56"></textarea></p>
<p><input type="submit" name="send" value="send"></p>
</form>

</td>
</table>

<a href="http://wolfb.com">hombrelobo</a>

<?php

} //end else

?>
</body></html>



------------------------------------------------------

Labels: , ,

posted by hombrelobo, Saturday, January 14, 2006
Add to del.icio.us Add to del.icio.us Stumble Upon ToolbarStumble It!


0 Comments:



Add a comment