A Donation FeedFlare for FeedBurner

Update: I have released the PHP source code for the PayPal donation FeedFlare I wrote. Please feel free to use it (edit as needed, and host on your server). You can find the source code at the end of this blog post.

FeedBurner, the processor for my blog’s feed, has a really cool feed optimization extension called FeedFlare (under the Optimize menu in your account). It allows additional links to be dynamically added under each feed item (see the catalog of available FeedFlare’s). Moreover, the FeedFlare API allows developers to create new FeedFlares (XML scripts) and integrate them with their feeds through FeedBurner.

So trying out the possibilities, I created a new FeedFlare which allows the feed subscribers to make a donation via PayPal. The “Donate via PayPal” FeedFlare adds a customized donation link below each feed item. This FeedFlare has the following customizable URL Parameters:

label -> link title (eg: Donate to XYZ etc.), if unspecified defaults to ‘Donate’;
msg -> message displayed on the PayPal payment page (eg: Donate to the XYZ Relief Fund etc.), if unspecified defaults to the FeedBurner blog feed title;
email -> PayPal e-mail address, if unspecified defaults to the FeedBurner author e-mail address;
curr -> currency code (eg: USD, GBP, EUR, AUD etc.), if unspecified defaults to USD;
locl -> locale ID (eg: US, UK, AU etc.), if unspecified defaults to US.

Usage example: https://www.nilkanth.com/feedflare/donate/?label=Donate to WorldVision&msg=Donation for WorldVision Children Fund&email=yourname@test.com&curr=AUD&locl=AU

PHP source code:

<?
// FeedBurner FeedFlare
// PayPalDonate v1 (3 Mar 2007)
// Developed by: Ashutosh Nilkanth (www.nilkanth.com)

$Tlabel = trim($_GET["label"]); // donation title message
$Tmsg = trim($_GET["msg"]); // donation title message
$Temail = trim($_GET["email"]); // PayPal email address
$Tcurr = trim($_GET["curr"]); // PayPal currency code
$Tloc = trim($_GET["locl"]); // PayPal currency code

if ( empty($Tlabel) )
	$Tlabel = "Donate";

if ( empty($Tmsg) )
	$Tmsg = "\${/a:feed/a:title}";
else
	$Tmsg = urlencode($Tmsg);

if ( empty($Temail) )
	$Temail = "\${(ancestor-or-self::*/a:author/a:email)[last()]}";
else
	$Temail = urlencode($Temail);

if ( empty($Tcurr) )
	$Tcurr = "USD";

if ( empty($Tloc) )
	$Tloc = "US";

header("Content-Type: text/xml");
header("Pragma: no-cache");

echo "<!DOCTYPE FeedFlareUnit SYSTEM \"http://www.feedburner.com/fb/static/flareunits/FeedFlareUnit-1.0.dtd\">\n";
?>
<FeedFlareUnit>
	<Catalog>
		<Title>Donate via PayPal</Title>
		<Description>Accept donations securely and conveniently using PayPal.com. Customizable URL Parameters: label -> link title (eg: Donate to XYZ etc.), if unspecified defaults to 'Donate'; msg -> message displayed on the PayPal payment page (eg: Donate to the XYZ Relief Fund etc.), if unspecified defaults to the FeedBurner blog feed title; email -> PayPal e-mail address, if unspecified defaults to the FeedBurner author e-mail address; curr -> currency code (eg: USD, GBP, EUR, AUD etc.), if unspecified defaults to USD; locl -> locale ID (eg: US, UK, AU etc.), if unspecified defaults to US. Usage example: https://www.nilkanth.com/feedflare/donate/?label=Donate to WorldVision&amp;msg=Donation for worldVision Children Fund&amp;email=yourname@domain.com&amp;curr=AUD&amp;locl=AU</Description>
		<Author>Ashutosh Nilkanth</Author>
	</Catalog>
	<FeedFlare>
		<Text><?echo $Tlabel;?></Text>
		<Link href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=<? echo $Temail;?>&amp;item_name=<?echo $Tmsg;?>&amp;no_shipping=0&amp;tax=0&amp;currency_code=<?echo urlencode($Tcurr);?>&amp;lc=<?echo urlencode($Tloc);?>&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" />
	</FeedFlare>
</FeedFlareUnit>

13 thoughts on “A Donation FeedFlare for FeedBurner”

  1. One frequent perceived technical problem with FeedBurner is the reduced number of subscribers being reported for the blogs using the service. This is not actually a technical problem with FeedBurner, but by the feed readers and aggregators that report to FeedBurner, as FeedBurner collects and tallies from those partners. Usually this problem is connected with one specific RSS reader or client. ..

  2. Love the idea of this but am thoroughly confused.

    1. What is the PHP code above for? And where should I put it?
    2. I uploaded the xml file on my server no problem. Shows up in the feedflare preview after I give the location but does not show up in the posts feedburner is sending out. Any ideas?
    3. I’m new to all this and am wondering how I can manually configure the xml at http://www.nilkanth.com/feedflare/donate/ ? Can you please give more details than the usage example above?

    Thanks in advance.

  3. i have the same email issue…is there a place in the theme editor or code of my blog that i could find this??

    my email address with feedburner is different than the one i have listed on paypal! i would like the donations to reach me , so i need to change the email address within the feedflame somehow,
    any tips please???

    and thanks for this feedflame, it’s a wonderful one….!
    z

  4. Hello

    Is there any way that instead of getting the blog title your feedflare would get the title of the particular post the visitor is tipping?

    Thank you.

  5. I just found this and thought I would give it a try. I’m new to feedburner and have been tweaking it out since I signed up earlier this week.

    I set this up on my server and it does wok with one small problem. The email address it attempts to send money to via paypal is a fake one I use in my RSS feed. I’ve goone into the feed and adjusted it, but it still tries to send payments to the bogus address.

    Is there a way to manually set the address in the xml file or do I need to make a change on feedburner its self?

    thanks!

  6. Hi Ashutosh:

    I’m with Adam… speaking for myself, I have no previous experience with “Feed Flare” to fall back on. A clear tutorial would go a long way in allowing what I suspect are a large number of folks to quickly and properly set-up your Pay Pal Donation Flare.

    BTW an extremely good (and needed) idea.

    I look forward to your positive reply.

    All The Best

    Tom G, Sr.

  7. Hi,

    I don’t seem to be able to get this flare to work.

    I’ve tried using the hosted copy, but I don’t understand how that could really work.

    I’ve also tried hosting it on my own server, but again when I add the labesl to the url as I submit it to feedburner, I encounter feed not found errors.

    It’s a great idea, which I would love to be able to make use of.

    Is there anyway you could do a step by step guide with the exact pieces of code and where they are submitted.

    Many thanks and best wishes

  8. Hi guys,

    The hosted version of the donation FeedFlare is located at http://www.nilkanth.com/feedflare/donate/ . So you can simply set this URL in your FeedBurner FeedFlare settings. If you wish to host this FeedFlare on your own server, then you must copy its XML source code, paste it in a XML text file (like paypal-feedflare.xml), and upload it to your server. Then you can set the FeedFlare location to the URL of the XML file on your server.

    Hope it helps!

  9. Hi, I can’t seem to get this to work, every time I upload the file feedburner says “We could not find a valid feedflare file at that location”.

Leave a Reply

Your email address will not be published. Required fields are marked *