<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>What About Ki? &#187; tutorial</title>
	<atom:link href="http://www.whataboutki.com/tag/tutorial/feed" rel="self" type="application/rss+xml" />
	<link>http://www.whataboutki.com</link>
	<description>Everything you need to know about Ki.</description>
	<lastBuildDate>Thu, 02 Sep 2010 23:40:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>whataboutki@gmail.com (What About Ki?)</managingEditor>
	<webMaster>whataboutki@gmail.com (What About Ki?)</webMaster>
	<image>
		<url>http://www.whataboutki.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>What About Ki?</title>
		<link>http://www.whataboutki.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Everything you need to know about Ki.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>What About Ki?</itunes:author>
	<itunes:owner>
		<itunes:name>What About Ki?</itunes:name>
		<itunes:email>whataboutki@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.whataboutki.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Tutorial &#8211; Let Your Readers SMS You</title>
		<link>http://www.whataboutki.com/reviews/web-reviews/tutorial-let-your-readers-sms-you</link>
		<comments>http://www.whataboutki.com/reviews/web-reviews/tutorial-let-your-readers-sms-you#comments</comments>
		<pubDate>Sun, 08 Mar 2009 02:36:24 +0000</pubDate>
		<dc:creator>Ki</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.whataboutki.com/?p=584</guid>
		<description><![CDATA[This is how I made it possible for readers of my blog to text message / SMS my phone for free from my wordpress blog. It&#8217;s a bit of a hack going through twitter and twe2, but it works. If you wanted to you could just have it so that readers can send you a [...]]]></description>
			<content:encoded><![CDATA[<p>This is how I made it possible for readers of my blog to text message / SMS my phone for free from my wordpress blog. It&#8217;s a bit of a hack going through <a href="http://www.twitter.com">twitter</a> and <a href="http://www.twe2.com">twe2</a>, but it works. If you wanted to you could just have it so that readers can send you a message on Twitter instead.</p>
<p>First you&#8217;ll need two twitter accounts. One that you usually use and one for your website. We are going to be using the Twitter API to send a direct message to your normal twitter account. Twitter doesn&#8217;t allow you to send a direct message to yourself, so you will need to have a second account for your site which we will use to send the message from.</p>
<p>Now if you are setting this up on a wordpress site you are going to have to install the <a href="http://bluesome.net/post/2005/08/18/50/">Exec-PHP plugin</a>. This plugin just lets you post php into a normal wordpress text widget or a wordpress post/page. We will be using a bit of PHP to send the message to Twitter.</p>
<div id="attachment_585" class="wp-caption alignleft" style="width: 229px"><a href="http://www.whataboutki.com/wp-content/uploads/2009/03/tabs.png"><img class="size-full wp-image-585 dtse-img dtse-post-584" title="Use the HTML tab!" src="http://www.whataboutki.com/wp-content/uploads/2009/03/tabs.png" alt="Use the HTML tab!" width="219" height="109" /></a><p class="wp-caption-text">Use the HTML tab!</p></div>
<p>Now that that is out of the way we can get down to business. You will need to post this code where you would like the &#8220;Send me a text message&#8221; form to be displayed. I put mine one a separate wordpress page. NB. If you are putting it onto a page or post in wordpress remember to enter it into the &#8216;HTML&#8217; editor not the &#8216;Visual&#8217; WYSIWYG editor. If you even click on the &#8216;Visual&#8217; editor tab once the code has been entered it will change the code and make it useless, causing you to start again.</p>
<p>Here is the code:</p>
<p>&lt;?php<br />
if (isset($_POST['submit'])) {</p>
<p>$twitter_status = $_POST['twitter_stat'];</p>
<p>if (strlen($twitter_status) &gt; 0) {</p>
<p>// Set username and password etc<br />
$username = &#8216;<span style="color: #ff0000;">enter_site_twitter_username</span>&#8216;;<br />
$password = &#8216;<span style="color: #ff0000;">enter_site_twitter_password</span>&#8216;;<br />
$sendto = &#8216;<span style="color: #ff0000;">enter_your_twitter_username</span> &#8216;;<br />
$direct = &#8216;d &#8216;;<br />
$message = $direct . $sendto . $twitter_status;<br />
// The twitter API address<br />
$url = &#8216;http://twitter.com/statuses/update.xml&#8217;;<br />
// Alternative JSON version<br />
// $url = &#8216;http://twitter.com/statuses/update.json&#8217;;<br />
// Set up and execute the curl process<br />
$curl_handle = curl_init();<br />
curl_setopt($curl_handle, CURLOPT_URL, &#8220;$url&#8221;);<br />
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);<br />
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($curl_handle, CURLOPT_POST, 1);<br />
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, &#8220;status=$message&#8221;);<br />
curl_setopt($curl_handle, CURLOPT_USERPWD, &#8220;$username:$password&#8221;);<br />
$buffer = curl_exec($curl_handle);<br />
curl_close($curl_handle);<br />
// check for success or failure<br />
if (empty($buffer)) {<br />
echo &#8216;message&#8217;;<br />
} else {<br />
echo &#8216;Thanks for the message.&#8217;;<br />
}</p>
<p>} else<br />
echo &#8220;&lt;p&gt;Error: I won&#8217;t send blank messages!&lt;/p&gt;&#8221;;<br />
}<br />
?&gt;</p>
<p>&lt;h2&gt;Send me a message:&lt;/h2&gt;</p>
<p>&lt;p&gt;&lt;strong&gt;What&#8217;s so important?&lt;/strong&gt;&lt;/p&gt;<br />
&lt;form action=&#8221;<span style="color: #ff0000;">&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;</span>&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;input name=&#8221;twitter_stat&#8221; type=&#8221;text&#8221; id=&#8221;twitter_stat&#8221; size=&#8221;40&#8243; maxlength=&#8221;120&#8243; /&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; id=&#8221;submit&#8221; value=&#8221;Send&#8221;/&gt;<br />
&lt;/form&gt;</p>
<p>I have highlighted the text that you need to change red. We will walk through those changes now. <span style="color: #ff0000;">enter_site_twitter_username <span style="color: #000000;">will need to be changed to your sites twitter username (remember you have 2, one for your site and one for you). </span></span></p>
<p><span style="color: #ff0000;">enter_site_twitter_password<span style="color: #000000;"> will be changed to your sites twitter </span></span><span style="color: #ff0000;"><span style="color: #000000;">password. The password is needed because the code rest of the code uses it to log on to twitter and send a message. Don&#8217;t worry no one will be able to see the password. </span></span></p>
<p><span style="color: #ff0000;">enter_your_twitter_username <span style="color: #000000;">will be changed to your real twitter username. This will be added to the start of the message your readers write so that it gets sent to your twitter account. Please remember to leave the empty space after your username. eg. &#8216;whataboutki &#8216;</span> <span style="color: #000000;">= good       &#8216;whataboutki&#8217; = bad</span></span></p>
<p><span style="color: #ff0000;">&lt;?php echo $_SERVER['PHP_SELF']; ?&gt; <span style="color: #000000;">this should be able to be left just the way it is if you are putting the code into a wordpress text widget. If you are putting it into a wordpress post or page then this will have to be replaced with the url of the post or page eg. http://www.whataboutki.com/text-sms</span></span></p>
<div id="attachment_588" class="wp-caption alignright" style="width: 310px"><a href="http://www.whataboutki.com/wp-content/uploads/2009/03/txt-message.png"><img class="size-medium wp-image-588 dtse-img dtse-post-584" title="Should look like this." src="http://www.whataboutki.com/wp-content/uploads/2009/03/txt-message-300x89.png" alt="Should look like this." width="300" height="89" /></a><p class="wp-caption-text">Should look like this.</p></div>
<p><span style="color: #ff0000;"><span style="color: #000000;">Once you have made the changes you should have a form that looks like this one your site. If you test it out it should send the message you type as a direct message to your normal twitter account from your sites twitter account. Yeah! </span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">Now you just need to get twitter to send that message to your phone. If you are in america then twitter can do this for you. Charges might apply. if you aren&#8217;t then you can set up a <a href="http://www.twe2.com">twe2</a> account. Twe2 will text your twitter direct messages and replies to your phone (<a href="http://www.twe2.com/about/countries.aspx">most countries</a>) free of charge. It uses another service Wadja to do this, so every message will have &#8216;&gt; FREE SMS <a href="http://WWW.WADJA.COM">WWW.WADJA.COM</a>&#8216; at the end.</span></span></p>
<p>Hope this helps some people out there. I know this stuff can be tricky and trust me I don&#8217;t really know what I&#8217;m doing either. Just playing around, it&#8217;s the best way to learn. Anywho if you know of a better way to do something I use in this tutorial or need something explained a bit better just leave a comment.</p>
<p>Also, I understand that this opens you up to the risk of spam. I hope to add a Captcha type thing to it at some stage.</p>



		<!-- Added by WP-DragToShare-eXtended Plugin -->
		<script type="text/javascript">
			dtsv.dtse_post_584_permalink = 'http://www.whataboutki.com/reviews/web-reviews/tutorial-let-your-readers-sms-you';
			dtsv.dtse_post_584_title = 'Tutorial – Let Your Readers SMS You';
		</script>
		<!-- End of WP-DragToShare-eXtended Plugin -->]]></content:encoded>
			<wfw:commentRss>http://www.whataboutki.com/reviews/web-reviews/tutorial-let-your-readers-sms-you/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

