<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Easyjo.com &#187; Code</title>
	<atom:link href="http://www.easyjo.com/category/code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.easyjo.com</link>
	<description>The home of Joel Richards</description>
	<lastBuildDate>Wed, 02 Feb 2011 22:54:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Virgin Money Giving API and Widgets</title>
		<link>http://www.easyjo.com/2011/02/02/virgin-money-giving-api-and-widgets</link>
		<comments>http://www.easyjo.com/2011/02/02/virgin-money-giving-api-and-widgets#comments</comments>
		<pubDate>Wed, 02 Feb 2011 22:46:02 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.easyjo.com/?p=438</guid>
		<description><![CDATA[As a followup to an unofficial API I wrote for Justgiving in 2009, which has recently been replaced with an official version I&#8217;m now releasing an unofficial API for Virgin Money Giving which I have been using for a VMG powered app for a while. Virgin Money Giving widgets (unofficial) You can view you automatically [...]]]></description>
			<content:encoded><![CDATA[<p>As a followup to an unofficial API I wrote for <a href="http://www.easyjo.com/2009/03/24/justgivingcom-api-dynamic-graphic-widgets" target="_blank">Justgiving</a> in 2009, which has recently been replaced with an official version I&#8217;m now releasing an unofficial <a href="http://api.jo.je/virginmoneygiving/" target="_blank">API for Virgin Money Giving</a> which I have been using for a VMG powered app for a while.</p>
<h1>Virgin Money Giving widgets (unofficial)</h1>
<p>You can view you automatically generated widget like this:</p>
<p><strong>&lt;img src=&#8221;http://api.jo.je/virginmoneygiving/view/</strong><strong>59024</strong><strong>&#8220;&gt;</strong></p>
<p>And replace paras10 with your virgin money giving page id</p>
<p><img src="http://api.jo.je/virginmoneygiving/view/59024" alt="" /></p>
<p>For events without targets, they will look like this:</p>
<p><strong>&lt;img  border=0 src=&#8221;http://api.jo.je/virginmoneygiving/view/22895&#8243;&gt;&lt;/a&gt;</strong></p>
<p>or for a forum&#8230;. <strong>[img]http://api.jo.je/virginmoneygiving/view/22895[/img]</strong></p>
<p><img src="http://api.jo.je/virginmoneygiving/view/22895" border="0" alt="" /></p>
<h1>Virgin Money Giving (unofficial)</h1>
<p>For any developers out there who want a quick way to get data about an event, more than provided by the RSS data, here&#8217;s a JSON feed you can use (replace &#8217;59024&#8242; as needed):</p>
<p><a href="http://api.jo.je/virginmoneygiving/data/59024" target="_new">http://api.jo.je/virginmoneygiving/data/59024</a></p>
<p>Which provides the following, in JSON format:</p>
<p>{<br />
   &#8220;title&#8221;:&#8221;AliceJohnson&#038;pageUrl=2&#8243;,<br />
   &#8220;image&#8221;:&#8221;http:\/\/uk.virginmoneygiving.com\/\/fundraiser-web\/donate\/downloadImage.action?fileName=\/167x18792353cbc-6d25-4654-babe-45ba9bf69d9b.bmp&#8221;,<br />
   &#8220;person&#8221;:&#8221;Alice Johnson&#8221;,<br />
   &#8220;donations&#8221;:[<br />
      {<br />
         "person":"Rob",<br />
         "amount":"10.00",<br />
         "gift_aid":0,<br />
         "date":"01.12.10",<br />
         "message":"I donate at least three pints of Guinness.."<br />
      }<br />
   ],<br />
   &#8220;charity&#8221;:&#8221;Link Community Development&#8221;,<br />
   &#8220;is_live&#8221;:true,<br />
   &#8220;money_target&#8221;:&#8221;350.00&#8243;,<br />
   &#8220;money_total&#8221;:&#8221;268.00&#8243;,<br />
   &#8220;money_gift_aid&#8221;:62.89,<br />
   &#8220;money_offline&#8221;:&#8221;0.00&#8243;,<br />
   &#8220;money_online&#8221;:268,<br />
   &#8220;event_id&#8221;:&#8221;59024&#8243;,<br />
   &#8220;has_target&#8221;:true,<br />
   &#8220;percentage_complete&#8221;:76,<br />
   &#8220;is_valid&#8221;:true,<br />
   &#8220;pub_date&#8221;:&#8221;2011-03-12 00:00:00&#8243;,<br />
   &#8220;extra_title&#8221;:&#8221;Alice Johnson&#8217;s fundraising page&#8221;<br />
}</p>
<p>This can be decided in PHP5+ using <a href="http://us2.php.net/json_decode" target="_new">json_decode()</a></p>
<p>site here: <a href="http://api.jo.je/virginmoneygiving/">http://api.jo.je/virginmoneygiving/</a></p>
<p>If you plan or using this for anything, please feel free, and drop me a message or comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easyjo.com/2011/02/02/virgin-money-giving-api-and-widgets/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Justgiving.com API</title>
		<link>http://www.easyjo.com/2010/07/19/justgiving-com-api</link>
		<comments>http://www.easyjo.com/2010/07/19/justgiving-com-api#comments</comments>
		<pubDate>Mon, 19 Jul 2010 18:07:35 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.easyjo.com/?p=411</guid>
		<description><![CDATA[Another update on the Justgiving.com API I&#8217;ve been developing Various new features include: Inclusion of information regarding recent donations (message, amount, user, date) Inclusion of charity info &#38; logo JSONP feed for cross domain requests JSON encapsulated error messages for ease of error handling The API documentation has also been updated and is viewable here [...]]]></description>
			<content:encoded><![CDATA[<p>Another update on the <a title="Justgiving.com API" href="http://api.jo.je/justgiving/">Justgiving.com API</a> I&#8217;ve been developing</p>
<p>Various new features include:</p>
<ul>
<li>Inclusion of information regarding recent donations (message, amount, user, date)</li>
<li>Inclusion of charity info &amp; logo</li>
<li>JSONP feed for cross domain requests</li>
<li>JSON encapsulated error messages for ease of error handling</li>
</ul>
<p>The API documentation has also been updated and is viewable here : <a href="http://api.jo.je/justgiving/">http://api.jo.je/justgiving/</a></p>
<p>A couple of recent examples of the API being implemented in other sites/apps are:</p>
<h2><a href="http://www.meningitis.org">Meningitis Research Foundation</a></h2>
<p>MSF (<a href="http://twitter.com/M_R_F">@M_R_F</a>) recently implemented the JSONP feed into their Book of Experience to show donation totals and recent messages.</p>
<div id="attachment_412" class="wp-caption alignnone" style="width: 438px"><a href="http://www.meningitis.org/book-of-experience/harry-mills-25156"><img class="size-full wp-image-412 " title="Book of Experience, Harry Mills" src="http://www.easyjo.com/wp-content/uploads/mrf.jpg" alt="" width="428" height="388" /></a><p class="wp-caption-text">Book of Experience, Harry Mills. displaying recent messages</p></div>
<h2><a title="JustTweeting.org.uk" href="http://Justtweeting.org.uk">Justtweeting.org.uk</a></h2>
<p><a href="http://Justtweeting.org.uk"><img class="size-full wp-image-414 alignnone" title="JT" src="http://www.easyjo.com/wp-content/uploads/JT.jpg" alt="" width="496" height="164" /></a><strong> </strong></p>
<blockquote><p><strong>&#8220;<a title="Justtweeting.org.uk" href="http://Justtweeting.org.uk">JustTweeting</a></strong> is a simple application that links     your JustGiving fundraising page to your Twitter account. It lets     you set up automatic twitter updates with your JustGiving page     address and fundraising totals. You can schedule these tweets     to be sent daily, weekly or monthly.&#8221;</p></blockquote>
<p><a title="Justtweeting.org.uk" href="http://Justtweeting.org.uk">JustTweeting</a> uses the Justgiving API for obtaining data regarding events, currently in Beta with new features incoming!</p>
<blockquote><p>This application was conceived over a couple of beers by     <a href="http://twitter.com/bigdavesb">Big Dave</a> and <a href="http://twitter.com/simonpainter">Simon</a>. We&#8217;re     part of a collective of volunteers known as the     <a href="http://ragabonds.org.uk/">Ragabonds</a>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.easyjo.com/2010/07/19/justgiving-com-api/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Justgiving.com API &amp; Dynamic graphic widgets</title>
		<link>http://www.easyjo.com/2009/03/24/justgivingcom-api-dynamic-graphic-widgets</link>
		<comments>http://www.easyjo.com/2009/03/24/justgivingcom-api-dynamic-graphic-widgets#comments</comments>
		<pubDate>Mon, 23 Mar 2009 23:07:10 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[justgiving]]></category>
		<category><![CDATA[justgiving.com]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.easyjo.com/?p=307</guid>
		<description><![CDATA[I decided to write these quickly as the I found the justgiving.com image widgets didn&#8217;t contain relevant event information, and didn&#8217;t fancy using their flash widget&#8230; anyhow here goes. Justgiving.com widgets (unofficial) You can view you automatically generated widget like this: &#60;img src=&#8221;http://api.jo.je/justgiving/view/paras10&#8243;&#62; And replace paras10 with your justgiving.com page name For events without targets, [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to write these quickly as the I found the justgiving.com image widgets didn&#8217;t contain relevant event information, and didn&#8217;t fancy using their flash widget&#8230; anyhow here goes.</p>
<h1>Justgiving.com widgets (unofficial)</h1>
<p>You can view you automatically generated widget like this:</p>
<p><strong>&lt;img src=&#8221;http://api.jo.je/justgiving/view/paras10&#8243;&gt;</strong></p>
<p>And replace paras10 with your justgiving.com page name</p>
<p><img src="http://api.jo.je/justgiving/view/paras10" alt="" /></p>
<p>For events without targets, they will look like this:</p>
<p><strong>&lt;a href=&#8221;http://justgiving.com/richardstobasecamp&#8221;&gt;&lt;img  border=0 src=&#8221;http://api.jo.je/justgiving/view/richardstobasecamp&#8221;&gt;&lt;/a&gt;</strong></p>
<p>or for a forum&#8230;. <strong>[url=http://justgiving.com/richardstobasecamp][img]http://api.jo.je/justgiving/view/richardstobasecamp[/img][/url]</strong></p>
<p><a href="http://justgiving.com/richardstobasecamp"><img src="http://api.jo.je/justgiving/view/richardstobasecamp" border="0" alt="" /></a></p>
<h1>Justgiving.com API (unofficial)</h1>
<p>For any developers out there who want a quick way to get data about an event, more than provided by the RSS data, here&#8217;s a JSON feed you can use (replace &#8216;richardstobasecamp&#8217; as needed):</p>
<p><a href="http://api.jo.je/justgiving/data/richardstobasecamp" target="_new">http://api.jo.je/justgiving/data/richardstobasecamp</a></p>
<p>Which provides the following, in JSON format:</p>
<p>{&#8220;charity&#8221;:&#8221;The Samaritans Of Guildford&#8221;,&#8221;title&#8221;:&#8221;Richards Family to Everest Base Camp&#8221;,&#8221;id&#8221;:&#8221;1524562&#8243;,&#8221;page_creator&#8221;:&#8221;Tony Richards&#8221;,&#8221;donations_target&#8221;:&#8221;\u00a30.00&#8243;,&#8221;donations_total&#8221;:&#8221;\u00a31,348.00&#8243;,&#8221;donations_online&#8221;:&#8221;\u00a31,238.00&#8243;,&#8221;donations_offline&#8221;:&#8221;\u00a3110.00&#8243;,&#8221;has_target&#8221;:false,&#8221;percentage_complete&#8221;:0}</p>
<p>This can be decided in PHP5+ using <a href="http://us2.php.net/json_decode" target="_new">json_decode()</a></p>
<p>site here: <a href="http://api.jo.je/justgiving/">http://api.jo.je/justgiving/</a></p>
<p>If you plan or using this for anything, please feel free, and drop me a message or comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easyjo.com/2009/03/24/justgivingcom-api-dynamic-graphic-widgets/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP 4 Twitter Class</title>
		<link>http://www.easyjo.com/2009/01/28/php-4-twitter-class</link>
		<comments>http://www.easyjo.com/2009/01/28/php-4-twitter-class#comments</comments>
		<pubDate>Wed, 28 Jan 2009 08:21:01 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.easyjo.com/?p=52</guid>
		<description><![CDATA[This now no longer works, due to the introduction of oAuth being a requirement for external messages sent to twitter PHP Twitter oAuth Old content below: I say class, it&#8217;s actually just 1 function for PHP 4+ to allow sending of twitter messages really simply. Based upon the PHP 5 twitter class by David Grudl [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>This now no longer works, due to the introduction of oAuth being a requirement for external messages sent to twitter</strong></span></p>
<p><a href="http://www.google.co.uk/search?q=php+twitter+oauth">PHP Twitter oAuth</a></p>
<p>Old content below:</p>
<p>I say class, it&#8217;s actually just 1 function for PHP 4+ to allow sending of twitter messages really simply.</p>
<p>Based upon the PHP 5 twitter class by <a href="http://phpfashion.com/">David Grudl</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> twitter_send<span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://twitter.com/statuses/update.xml'</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'status'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$curl</span> <span style="color: #339933;">=</span> curl_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_HTTPHEADER<span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Expect:'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		curl_setopt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// no echo, just return result</span>
		<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> curl_exec<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$ok</span> <span style="color: #339933;">=</span> curl_errno<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> curl_getinfo<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLINFO_HTTP_CODE<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">200</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s it, and then just a call function to send a message:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">twitter_send<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello World!&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;myusername&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;passwordhere&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Simple!</p>
<p>The function also returns XML from twitter, including data such as followers_count, current description, location, profile_image_url etc, if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easyjo.com/2009/01/28/php-4-twitter-class/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

