<?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>TimeWaster's Place &#187; php</title>
	<atom:link href="http://www.timewaster.de/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timewaster.de</link>
	<description>Programming, Design, Tekkie Stuff and more</description>
	<lastBuildDate>Wed, 04 Aug 2010 14:02:03 +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>Twitter made easy &#8211; How to tweet with PHP with 19 lines of code</title>
		<link>http://www.timewaster.de/twitter-made-easy-how-to-tweet-with-php-in-17-lines-of-code/</link>
		<comments>http://www.timewaster.de/twitter-made-easy-how-to-tweet-with-php-in-17-lines-of-code/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:38:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programmierung]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=185</guid>
		<description><![CDATA[You know the dilemma, you want to write a simple tweeting PHP script and have to mess around with the Twitter API.
With the following small script you can tweet with a simple function call. It IS that simple (And SSL secured!!!).
Here&#8217;s the function:
function tweet($user, $pass, $text) {
	unset($GLOBALS['tweetError']);
	if(strlen($text) > 140) { $GLOBALS['tweetError'] = 'TEXT TOO LONG: [...]]]></description>
			<content:encoded><![CDATA[<p>You know the dilemma, you want to write a simple tweeting PHP script and have to mess around with the Twitter API.<br />
With the following small script you can tweet with a simple function call. It IS that simple (And SSL secured!!!).</p>
<p>Here&#8217;s the function:</p>
<pre><code>function tweet($user, $pass, $text) {
	unset($GLOBALS['tweetError']);
	if(strlen($text) > 140) { $GLOBALS['tweetError'] = 'TEXT TOO LONG: '.$text; return false; }
	$tweet = curl_init();
	curl_setopt($tweet, CURLOPT_URL, 'https://www.twitter.com/statuses/update.xml');
	curl_setopt($tweet, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($tweet, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($tweet, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode($user.':'.$pass)));
	curl_setopt($tweet, CURLOPT_POST, 1);
	curl_setopt($tweet, CURLOPT_POSTFIELDS, 'status='.utf8_encode($text));
	if(!$return = curl_exec($tweet)) $GLOBALS['tweetError'] = 'CURL ERROR: '.curl_error($tweet);
	else if($returnData = simplexml_load_string($return)) {
		if(!isSet($returnData->error)) $GLOBALS['tweetSuccess'] = 'Created at: '.$returnData->created_at.'Text: '.utf8_decode($returnData->text);
		else $GLOBALS['tweetError'] = 'TWITTER ERROR: '.$returnData->error;
	} else $GLOBALS['tweetError'] = 'RETURN IS NOT XML: '.$return;
	curl_close($tweet);
	return (isSet($GLOBALS['tweetError']))?false:true;
}</code></pre>
<p>To make a tweet just call the function:</p>
<pre><code>tweet("username", "password", "My cool tweet!");</code></pre>
<p>The function returns &#8220;true&#8221; if successful or &#8220;false&#8221; if not.<br />
To echo out the error or success messages, just use this code:</p>
<pre><code>if(tweet("username", "password", "My cool tweet!")) {
	echo 'Tweet Successful!'.$GLOBALS['tweetSuccess'];
} else {
	echo 'Tweet Error!'.$GLOBALS['tweetError'];
}</code></pre>
<p>If there was an error, the error description is saved in $GLOBALS['tweetError'], and if the tweet was successful, the time and the text itself is saved in $GLOBALS['tweetSuccess'].</p>
<p>Have fun and happy (automatic?) tweeting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/twitter-made-easy-how-to-tweet-with-php-in-17-lines-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarks Plugin for Roundcube</title>
		<link>http://www.timewaster.de/bookmarks-plugin-for-roundcube/</link>
		<comments>http://www.timewaster.de/bookmarks-plugin-for-roundcube/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 11:11:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bookmark]]></category>
		<category><![CDATA[bookmarks]]></category>
		<category><![CDATA[favorites]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[linklist]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[roundcube]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=32</guid>
		<description><![CDATA[This is a simple Bookmarks &#8220;Plugin&#8221; for Roundcube. With it, you can administrate all your bookmarks (or favorites) within the web-mailer surface.
It is nether beautiful nor has it a browser bookmarks import capability, but it works. The installation is rather simple, but the included files are only valid for the current RoundCube version 0.2-beta. you [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple Bookmarks &#8220;Plugin&#8221; for <a href="http://www.roundcube.net/">Roundcube</a>. With it, you can administrate all your bookmarks (or favorites) within the web-mailer surface.</p>
<p>It is nether beautiful nor has it a browser bookmarks import capability, but it works. The installation is rather simple, but the included files are only valid for the current RoundCube version 0.2-beta. you should not install this plugin if the versions do not match.</p>
<p>Here you can find a <a href="/pages/rc_bookmarks/rc_bookmarks.png">sample preview image</a>.</p>
<p>&nbsp;</p>
<p><strong>Before installing, please note:</strong></p>
<ul>
<li>IT WILL ONLY WORK WITH MYSQL AND ROUNDCUBE v0.2-BETA (For sure it will work with future versions, but i don&#8217;t guarantee this).</li>
<li>It is NOT multi-user capable (All users will see the same bookmarks).</li>
<li>It is not multi-language capable.</li>
<li>It will overwrite two files in the &#8220;default&#8221; skin (The menu and the .css).</li>
<li>It will not preserve sessions, so dont use it for a long time, otherwise your session will be lost.</li>
<li>It will create a new table in your database.</li>
<li>There will be no future support or development (It simply does what i want, so im fine with it as is).</li>
</ul>
<p>Please don&#8217;t install this plugin if you don&#8217;t agree with this conditions.</p>
<p>&nbsp;</p>
<p><strong>Installation: (could not be easier)</strong></p>
<ol>
<li>copy the .zip file to your <roundcube_installation_directory>/skins/ folder</li>
<li>unzip it (with overwriting files option)</li>
<li>reload your roundcube, click on the bookmarks link, add in the url field of your browser at the end of url: &#8220;&#038;createTable=true&#8221; (without the brakets) and hit &#8220;enter&#8221;. if this fails (a message &#8220;could not create table&#8221; appears) you have to add the new table with your favorite sql tool (phpmyadmin for instance), for this, copy the sql statement from line 16 from the /default/bookmarks/index.php file in the zip file.</li>
</ol>
<p>now youre all done.</p>
<p>&nbsp;</p>
<p><strong>Download:</strong><br />
<a href="/pages/rc_bookmarks/RoundCube_Bookmarks_for_v0.2-beta.zip">RoundCube Bookmarks Plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/bookmarks-plugin-for-roundcube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
