<?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>Internet Marketing - Bobby Jason &#187; PHP</title>
	<atom:link href="http://bobbyjason.co.uk/blog/category/tutorials/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobbyjason.co.uk/blog</link>
	<description>Internet Marketing From a Web Developer</description>
	<lastBuildDate>Thu, 25 Feb 2010 15:38:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hacking TweetMyBlog (TwitterFeed Sucks)</title>
		<link>http://bobbyjason.co.uk/blog/64/hacking-tweetmyblog-twitterfeed-sucks/</link>
		<comments>http://bobbyjason.co.uk/blog/64/hacking-tweetmyblog-twitterfeed-sucks/#comments</comments>
		<pubDate>Sun, 17 May 2009 14:12:27 +0000</pubDate>
		<dc:creator>BobbyJason</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[tinyurl]]></category>
		<category><![CDATA[tweetmyblog]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitterfeed]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://bobbyjason.co.uk/blog/?p=64</guid>
		<description><![CDATA[I used to use TwitterFeed; but recently it&#8217;s been a real pain in the ass and not updating so I looked for an alternative.
Roll on TweetMyBlog.
TweetMyBlog is great for the simple fact that it is a WordPress plugin. It&#8217;s also a small download, and you can install it very easily. However, TweetMyBlog is hard-coded to [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I used to use TwitterFeed; but recently it&#8217;s been a real pain in the ass and not updating so I looked for an alternative.</p>
<p>Roll on TweetMyBlog.</p>
<p>TweetMyBlog is great for the simple fact that it is a WordPress plugin. It&#8217;s also a small download, and you can install it very easily. However, TweetMyBlog is hard-coded to use TinyURL and the URL it &#8220;makes tiny&#8221; is an affiliate link taking the user to a framed page. This is a bit of a bummer for me because I like to use bit.ly and I don&#8217;t really want my users going to some 3rd party site.</p>
<p>Roll on TweetMyBlog Hack</p>
<p>I took at a look @ the files and realise we can very easily change the Plugin to use bit.ly instead of TinyURL using the <a title="bit.ly api" href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation" target="_blank">bit.ly API</a>.</p>
<p>If you have installed TweetMyBlog you would have uploaded the &#8220;tweetmyblog&#8221; directory which had 3 files in it. Go and find, &#8220;twitter_api.php&#8221;:</p>
<p>and at the very bottom of the file you will see:</p>
<p>&#8221;</p>
<pre>function get_tiny_url($url)
{
$this-&gt;snoopy-&gt;fetch('http://tinyurl.com/api-create.php?url='.$url);
return $this-&gt;snoopy-&gt;results;
}</pre>
<p>&#8221;<br />
As you can see, it uses TinyURL.</p>
<p>I&#8217;ve only hacked it to use bit.ly, but this is what I changed it to first (don&#8217;t copy it yet, there&#8217;s a better version further down):</p>
<p>&#8221;</p>
<pre>   function get_tiny_url($url)
	{
    $this-&gt;snoopy-&gt;fetch('http://api.bit.ly/shorten?version=2.0.1&amp;login=bobbyjason&amp;apiKey=MYLONG_BIT_LY_API_KEY&amp;format=text&amp;longUrl='.$url);
	 return $this-&gt;snoopy-&gt;results;
	}</pre>
<p>&#8221;<br />
I gave it a shot, and sure enough it worked, I was using bit.ly instead of tinyurl, result! However, it was still using the silly Affiliate link with a frame &amp; 3rd party site.</p>
<p>Okay, open &#8220;tweetmyblog.php&#8221; at around line 36 you will see:</p>
<pre>$tweet = trim($tweetPrefix).' '.$blogPost-&gt;post_title.' '.$t-&gt;get_tiny_url('http://www.tweetmyblog.com/bpredir.php?r='.$tmb_affid.'&amp;bp='. urlencode(get_permalink($postID)));</pre>
<p>The problem is the tweetmyblog.com redirection, so I replaced it with this:</p>
<pre>$tweet = trim($tweetPrefix).' '.$blogPost-&gt;post_title.' '.$t-&gt;get_tiny_url(urlencode(get_permalink($postID)));</pre>
<p>Easy, right?</p>
<p>Well, this works great.</p>
<p>I do not need to use TwitterFeed ever again because WordPress automatically Tweets my blog post! I don&#8217;t have to wait 30 minutes, 1 hour, 5 hours for TwitterFeed to notice my blog post.</p>
<p>There was one last change that I made; after using the code above (using the bit.ly api) I realised that the URL wasn&#8217;t showing up in my bit.ly history. I checked this out and realised I needed to use the history=1 parameter. After I added this I&#8217;ve not had a single problem at all.<br />
For the final code of &#8220;twitter_api.php&#8221;, see below:</p>
<pre>function get_tiny_url($url)
	{
    $this-&gt;snoopy-&gt;fetch('http://api.bit.ly/shorten?version=2.0.1&amp;history=1&amp;login=bobbyjason&amp;apiKey=MYLONG_BIT_LY_API_KEY&amp;format=text&amp;longUrl='.$url);
	 return $this-&gt;snoopy-&gt;results;
	}</pre>
<p>I must say though; <a title="download tweetmyblog" href="http://www.tweetmyblog.com/?rid=12043" target="_blank">TweetMyBlog </a>is a great plugin by John Merrick and Sean Jordansen and you should install it.</p>
<p>If you wish to monetise your tweets from your blog, then the above edits are silly. It&#8217;s just personally I would rather not have the user taken to a 3rd party site.</p>
<p>TweetMyBlog also provides a feed of your Tweets as a Widget, so it really is great!</p>
<p><a title="download tweetmyblog" href="http://www.tweetmyblog.com/?rid=12043" target="_blank">Download TweetMyBlog now</a>!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29&amp;bodytext=I%20used%20to%20use%20TwitterFeed%3B%20but%20recently%20it%27s%20been%20a%20real%20pain%20in%20the%20ass%20and%20not%20updating%20so%20I%20looked%20for%20an%20alternative.%0D%0A%0D%0ARoll%20on%20TweetMyBlog.%0D%0A%0D%0ATweetMyBlog%20is%20great%20for%20the%20simple%20fact%20that%20it%20is%20a%20WordPress%20plugin.%20It%27s%20also%20a%20small%20download%2C%20a" title="Digg"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29&amp;notes=I%20used%20to%20use%20TwitterFeed%3B%20but%20recently%20it%27s%20been%20a%20real%20pain%20in%20the%20ass%20and%20not%20updating%20so%20I%20looked%20for%20an%20alternative.%0D%0A%0D%0ARoll%20on%20TweetMyBlog.%0D%0A%0D%0ATweetMyBlog%20is%20great%20for%20the%20simple%20fact%20that%20it%20is%20a%20WordPress%20plugin.%20It%27s%20also%20a%20small%20download%2C%20a" title="del.icio.us"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;t=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="Facebook"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;h=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="NewsVine"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="Reddit"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="StumbleUpon"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29&amp;annotation=I%20used%20to%20use%20TwitterFeed%3B%20but%20recently%20it%27s%20been%20a%20real%20pain%20in%20the%20ass%20and%20not%20updating%20so%20I%20looked%20for%20an%20alternative.%0D%0A%0D%0ARoll%20on%20TweetMyBlog.%0D%0A%0D%0ATweetMyBlog%20is%20great%20for%20the%20simple%20fact%20that%20it%20is%20a%20WordPress%20plugin.%20It%27s%20also%20a%20small%20download%2C%20a" title="Google Bookmarks"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;submitHeadline=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29&amp;submitSummary=I%20used%20to%20use%20TwitterFeed%3B%20but%20recently%20it%27s%20been%20a%20real%20pain%20in%20the%20ass%20and%20not%20updating%20so%20I%20looked%20for%20an%20alternative.%0D%0A%0D%0ARoll%20on%20TweetMyBlog.%0D%0A%0D%0ATweetMyBlog%20is%20great%20for%20the%20simple%20fact%20that%20it%20is%20a%20WordPress%20plugin.%20It%27s%20also%20a%20small%20download%2C%20a&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29%20-%20http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F" title="Twitter"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F" title="Technorati"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="Live"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;title=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29&amp;source=Internet+Marketing+-+Bobby+Jason+Internet+Marketing+From+a+Web+Developer&amp;summary=I%20used%20to%20use%20TwitterFeed%3B%20but%20recently%20it%27s%20been%20a%20real%20pain%20in%20the%20ass%20and%20not%20updating%20so%20I%20looked%20for%20an%20alternative.%0D%0A%0D%0ARoll%20on%20TweetMyBlog.%0D%0A%0D%0ATweetMyBlog%20is%20great%20for%20the%20simple%20fact%20that%20it%20is%20a%20WordPress%20plugin.%20It%27s%20also%20a%20small%20download%2C%20a" title="LinkedIn"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;t=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29" title="MySpace"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
</ul>
</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fbobbyjason.co.uk%2Fblog%2F64%2Fhacking-tweetmyblog-twitterfeed-sucks%2F&amp;linkname=Hacking%20TweetMyBlog%20%28TwitterFeed%20Sucks%29"><img src="http://bobbyjason.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://bobbyjason.co.uk/blog/64/hacking-tweetmyblog-twitterfeed-sucks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.574 seconds -->
