<?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; Projects</title>
	<atom:link href="http://www.easyjo.com/category/projects/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>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>

