<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: ScheduledTweets: Free And Fully Ajaxed PHP Application To Schedule Tweets</title>
	<atom:link href="http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/</link>
	<description>Free Web Resources</description>
	<lastBuildDate>Fri, 12 Mar 2010 20:59:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: David</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-115524</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 28 Feb 2010 05:53:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-115524</guid>
		<description>Umut,

Incidentally, you mention that there were some known problems.  Are you aware of anything else that hasn&#039;t been touched on in these comments?

Definitely three cheers for open source!

David</description>
		<content:encoded><![CDATA[<p>Umut,</p>
<p>Incidentally, you mention that there were some known problems.  Are you aware of anything else that hasn&#8217;t been touched on in these comments?</p>
<p>Definitely three cheers for open source!</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-115522</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 28 Feb 2010 05:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-115522</guid>
		<description>Umut,

Many thanks.  I know the feeling all too well of not getting the last 5% done :-)!

I had thought about this before but didn&#039;t give it much attention.  The $dayToUse = date(&#039;w&#039;) + 1 (when == 0 ) isn&#039;t right. You&#039;re using 1-7 for Monday through Sunday, so that would theoretically duplicate Monday&#039;s schedule twice.

Although, and I&#039;m far too tired right now to delve into it, that&#039;s not what happened.  Instead, I noticed that after midnight on Saturday (thus, on Sunday) tweets began sending at the cron-job interval (in my case, 5 minutes) rather than at any interval listed in the &#039;schedules&#039; table (all greater than 10 minutes).

I&#039;ve changed:

=====
if (date(&#039;w&#039;) == 0) {
        $dayToUse = date(&#039;w&#039;) + 1;
} else {
        $dayToUse = date(&#039;w&#039;);
}
=====

to:

=====
if (date(&#039;w&#039;) == 0) {                                                                       
        $dayToUse= &#039;7&#039;;                                      
} else {
        $dayToUse = date(&#039;w&#039;);
}

=====

And now I&#039;m going to get some much-needed sleep. ;-)

Best,

David</description>
		<content:encoded><![CDATA[<p>Umut,</p>
<p>Many thanks.  I know the feeling all too well of not getting the last 5% done <img src='http://www.webresourcesdepot.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> !</p>
<p>I had thought about this before but didn&#8217;t give it much attention.  The $dayToUse = date(&#8216;w&#8217;) + 1 (when == 0 ) isn&#8217;t right. You&#8217;re using 1-7 for Monday through Sunday, so that would theoretically duplicate Monday&#8217;s schedule twice.</p>
<p>Although, and I&#8217;m far too tired right now to delve into it, that&#8217;s not what happened.  Instead, I noticed that after midnight on Saturday (thus, on Sunday) tweets began sending at the cron-job interval (in my case, 5 minutes) rather than at any interval listed in the &#8217;schedules&#8217; table (all greater than 10 minutes).</p>
<p>I&#8217;ve changed:</p>
<p>=====<br />
if (date(&#8216;w&#8217;) == 0) {<br />
        $dayToUse = date(&#8216;w&#8217;) + 1;<br />
} else {<br />
        $dayToUse = date(&#8216;w&#8217;);<br />
}<br />
=====</p>
<p>to:</p>
<p>=====<br />
if (date(&#8216;w&#8217;) == 0) {<br />
        $dayToUse= &#8216;7&#8242;;<br />
} else {<br />
        $dayToUse = date(&#8216;w&#8217;);<br />
}</p>
<p>=====</p>
<p>And now I&#8217;m going to get some much-needed sleep. <img src='http://www.webresourcesdepot.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Best,</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umut M.</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-111897</link>
		<dc:creator>Umut M.</dc:creator>
		<pubDate>Mon, 15 Feb 2010 17:18:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-111897</guid>
		<description>@David,

What you&#039;re doing is great.

Scheduled Tweets is 95% complete but had that 5% problems which was causing problems. I did some updates locally but couldn&#039;t find time complete &amp; organize them.

It&#039;ll be great that you post any updates you make, I&#039;ll be watching them and once you&#039;re ok, I&#039;ll update the download.

Again, thanks so much, this is why I love open source :).</description>
		<content:encoded><![CDATA[<p>@David,</p>
<p>What you&#8217;re doing is great.</p>
<p>Scheduled Tweets is 95% complete but had that 5% problems which was causing problems. I did some updates locally but couldn&#8217;t find time complete &#038; organize them.</p>
<p>It&#8217;ll be great that you post any updates you make, I&#8217;ll be watching them and once you&#8217;re ok, I&#8217;ll update the download.</p>
<p>Again, thanks so much, this is why I love open source <img src='http://www.webresourcesdepot.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-111893</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 15 Feb 2010 17:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-111893</guid>
		<description>A few other things of note:

1) As James West points out, add &quot;$status = urlencode($status);&quot; near the beginning of the if statements (such as under the &quot;$tweetUrl = ...&quot; statement.

2) The script does exactly what it&#039;s supposed to.  Unless you are encountering a technical issue (i.e. connection issue with mySQL database), you may be expecting something different of it.  For example, tweets go out at the interval scheduled, during the days and times entered (don&#039;t miss this step), and when Scheduled Tweets is &quot;started&quot; but not when it is &quot;stopped&quot;.  Each tweet you enter will only ever get tweeted once (tweetStatus flag), so if you enter three tweets and have an interval of 5 minutes--and you don&#039;t enter more tweets--cron will continue running the job but you won&#039;t see anything new after about 15 minutes.  As written, it doesn&#039;t loop and the same tweets aren&#039;t then tweeted the next day.

3) FYI, I&#039;m not the David or Dave who posted _prior_ to today.

Best,

David</description>
		<content:encoded><![CDATA[<p>A few other things of note:</p>
<p>1) As James West points out, add &#8220;$status = urlencode($status);&#8221; near the beginning of the if statements (such as under the &#8220;$tweetUrl = &#8230;&#8221; statement.</p>
<p>2) The script does exactly what it&#8217;s supposed to.  Unless you are encountering a technical issue (i.e. connection issue with mySQL database), you may be expecting something different of it.  For example, tweets go out at the interval scheduled, during the days and times entered (don&#8217;t miss this step), and when Scheduled Tweets is &#8220;started&#8221; but not when it is &#8220;stopped&#8221;.  Each tweet you enter will only ever get tweeted once (tweetStatus flag), so if you enter three tweets and have an interval of 5 minutes&#8211;and you don&#8217;t enter more tweets&#8211;cron will continue running the job but you won&#8217;t see anything new after about 15 minutes.  As written, it doesn&#8217;t loop and the same tweets aren&#8217;t then tweeted the next day.</p>
<p>3) FYI, I&#8217;m not the David or Dave who posted _prior_ to today.</p>
<p>Best,</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-111885</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 15 Feb 2010 16:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-111885</guid>
		<description>How ironic.  I said I could be careful about using tags, and then in my post I used symbols that didn&#039;t translate well :-).

Number 3 should read...

3) In the section [-= if ($action == &quot;newTweet&quot;){ =-] just before [-= $query = &quot;INSERT INTO tweets... =-] I added:

David</description>
		<content:encoded><![CDATA[<p>How ironic.  I said I could be careful about using tags, and then in my post I used symbols that didn&#8217;t translate well <img src='http://www.webresourcesdepot.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>Number 3 should read&#8230;</p>
<p>3) In the section [-= if ($action == "newTweet"){ =-] just before [-= $query = "INSERT INTO tweets... =-] I added:</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-111882</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 15 Feb 2010 16:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-111882</guid>
		<description>Thanks Umut! I was preparing to write a similar script but decided to see what might be available first. Much appreciated.

Thanks also to Steve for bug-fix suggestions.

I modified functions.php in a couple of ways that others might find helpful (and probably won&#039;t stop there)...

***

1: My error_log was filling up faster than I could keep track of it because of the lack of parameters usualy being sent and the interval of the cron job.  I added this function and changed the variable assignment accordingly.  Note that I commented out the use of the myfilter class, figuring that if I&#039;m the only one adding the tweets that I could know to be careful about using tags and such.

function setVar ($varName) {

        if (!empty($_POST[$varName])) {
                $checkValue = $_POST[$varName];
        } else {
                if (!empty($_GET[$varName])) $checkValue = $_GET[$varName];
                else $checkValue = &#039;&#039;;
        }

        return $checkValue;

}

$installDBName                  = setVar(&#039;installDBName&#039;);
$installDBUser                  = setVar(&#039;installDBUser&#039;);
$installDBPass                  = setVar(&#039;installDBPass&#039;);
$installDBHost                  = setVar(&#039;installDBHost&#039;);
etc., etc. [make sure to catch them all--there&#039;s one GET and the rest are POST]

***

2) I also quoted the &#039;w&#039; in this section of code (in 3 places) to eliminate those error_log entries:

if (date(&#039;w&#039;) == 0) {
        $dayToUse                               = date(&#039;w&#039;) + 1;
} else {
        $dayToUse                               = date(&#039;w&#039;);
}

***

3) In the &gt;&gt; if ($action == &quot;newTweet&quot;){ &lt;&gt; $query = &quot;INSERT INTO tweets... &lt;&lt;, I added:

        $tweetDetails = str_replace(chr(10),&#039;&#039;,$tweetDetails);
        $tweetDetails = str_replace(chr(13),&#039;&#039;,$tweetDetails);
        $tweetDetails = mysql_real_escape_string($tweetDetails);

This removes carriage returns and newlines that might inadvertently get put into the tweet, and also properly escapes various characters appropriate for insertion in mySQL such as quotation marks, apostrophes and backslashes (see php.net/mysqlreal_escape_string)

***

4) A minor change but worth considering:

The text &quot;Error, insert query failed&quot; appears in six places in the code and &quot;Error, update query failed&quot; appears in three.  I numbered them so I&#039;d be able to tell where a problem was occuring (i.e. failed #1..#6,failed #1..#3).

***

Hope this proves to be helpful for others.

David</description>
		<content:encoded><![CDATA[<p>Thanks Umut! I was preparing to write a similar script but decided to see what might be available first. Much appreciated.</p>
<p>Thanks also to Steve for bug-fix suggestions.</p>
<p>I modified functions.php in a couple of ways that others might find helpful (and probably won&#8217;t stop there)&#8230;</p>
<p>***</p>
<p>1: My error_log was filling up faster than I could keep track of it because of the lack of parameters usualy being sent and the interval of the cron job.  I added this function and changed the variable assignment accordingly.  Note that I commented out the use of the myfilter class, figuring that if I&#8217;m the only one adding the tweets that I could know to be careful about using tags and such.</p>
<p>function setVar ($varName) {</p>
<p>        if (!empty($_POST[$varName])) {<br />
                $checkValue = $_POST[$varName];<br />
        } else {<br />
                if (!empty($_GET[$varName])) $checkValue = $_GET[$varName];<br />
                else $checkValue = &#8221;;<br />
        }</p>
<p>        return $checkValue;</p>
<p>}</p>
<p>$installDBName                  = setVar(&#8216;installDBName&#8217;);<br />
$installDBUser                  = setVar(&#8216;installDBUser&#8217;);<br />
$installDBPass                  = setVar(&#8216;installDBPass&#8217;);<br />
$installDBHost                  = setVar(&#8216;installDBHost&#8217;);<br />
etc., etc. [make sure to catch them all--there's one GET and the rest are POST]</p>
<p>***</p>
<p>2) I also quoted the &#8216;w&#8217; in this section of code (in 3 places) to eliminate those error_log entries:</p>
<p>if (date(&#8216;w&#8217;) == 0) {<br />
        $dayToUse                               = date(&#8216;w&#8217;) + 1;<br />
} else {<br />
        $dayToUse                               = date(&#8216;w&#8217;);<br />
}</p>
<p>***</p>
<p>3) In the &gt;&gt; if ($action == &#8220;newTweet&#8221;){ &lt;&gt; $query = &#8220;INSERT INTO tweets&#8230; &lt;&lt;, I added:</p>
<p>        $tweetDetails = str_replace(chr(10),&#039;&#039;,$tweetDetails);<br />
        $tweetDetails = str_replace(chr(13),&#039;&#039;,$tweetDetails);<br />
        $tweetDetails = mysql_real_escape_string($tweetDetails);</p>
<p>This removes carriage returns and newlines that might inadvertently get put into the tweet, and also properly escapes various characters appropriate for insertion in mySQL such as quotation marks, apostrophes and backslashes (see php.net/mysqlreal_escape_string)</p>
<p>***</p>
<p>4) A minor change but worth considering:</p>
<p>The text &quot;Error, insert query failed&quot; appears in six places in the code and &quot;Error, update query failed&quot; appears in three.  I numbered them so I&#039;d be able to tell where a problem was occuring (i.e. failed #1..#6,failed #1..#3).</p>
<p>***</p>
<p>Hope this proves to be helpful for others.</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umut M.</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-105918</link>
		<dc:creator>Umut M.</dc:creator>
		<pubDate>Sun, 17 Jan 2010 19:38:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-105918</guid>
		<description>@Danny,

The cron address must be: http://www.yourdomainname.com/inc/functions.php?getAction=cronTweet</description>
		<content:encoded><![CDATA[<p>@Danny,</p>
<p>The cron address must be: <a href="http://www.yourdomainname.com/inc/functions.php?getAction=cronTweet" rel="nofollow">http://www.yourdomainname.com/inc/functions.php?getAction=cronTweet</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-105872</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 17 Jan 2010 15:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-105872</guid>
		<description>Thanks for this. One question - what should the &#039;command&#039; be for the cron job?</description>
		<content:encoded><![CDATA[<p>Thanks for this. One question &#8211; what should the &#8216;command&#8217; be for the cron job?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bright-Tutorials</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-102817</link>
		<dc:creator>Bright-Tutorials</dc:creator>
		<pubDate>Tue, 05 Jan 2010 23:19:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-102817</guid>
		<description>Very useful information. Thanks I will be taking this apart and making it into a cron. The source code will be available at http://bright-tutorials.com if anyone wants it.

Thanks!</description>
		<content:encoded><![CDATA[<p>Very useful information. Thanks I will be taking this apart and making it into a cron. The source code will be available at <a href="http://bright-tutorials.com" rel="nofollow">http://bright-tutorials.com</a> if anyone wants it.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umut M.</title>
		<link>http://www.webresourcesdepot.com/scheduledtweets-free-and-fully-ajaxed-php-application-to-schedule-tweets/comment-page-2/#comment-99890</link>
		<dc:creator>Umut M.</dc:creator>
		<pubDate>Fri, 25 Dec 2009 05:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.webresourcesdepot.com/?p=884#comment-99890</guid>
		<description>@Soso,

In your RSS reader, check the latest WRD post:
You&#039;ll find &quot;special downloads&quot; at the bottom of the post.</description>
		<content:encoded><![CDATA[<p>@Soso,</p>
<p>In your RSS reader, check the latest WRD post:<br />
You&#8217;ll find &#8220;special downloads&#8221; at the bottom of the post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 5/19 queries in 0.062 seconds using disk

Served from: www.webresourcesdepot.com @ 2010-03-13 11:02:45 -->