tag:blogger.com,1999:blog-15136575.post2267028320419266625..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: My Super Simple Node Twitter Re-TweeterMike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-15136575.post-43013447726810842132013-06-28T23:06:51.207+01:002013-06-28T23:06:51.207+01:00Does this actually work ? Here's a snippet of ...Does this actually work ? Here's a snippet of my code :<br /><br />function testForHashtag(data) {<br /> console.log('entering testForHashtag');<br /> if(data.retweeted) return;<br /> console.log('checking for RT');<br /> if(data.text.indexOf(hashtag3) >= 0) return;<br /> console.log('checking for hashtag match');<br /> if(data.text.indexOf(hashtag1) >= 0 || data.text.indexOf(hashtag2) >= 0 ) {<br /> console.log('sending retweet');<br /> twit.retweetStatus(data.id_str, function(){<br /> console.log('retweet callback');<br /> });<br /> }<br />}<br /><br />And, indeed, it gives the illusion that it works:<br /><br />raphaelclancy: #silverfire #fire More thick smoke today. http://t.co/HbTCy84LoT<br />entering testForHashtag<br />checking for RT<br />checking for hashtag match<br />sending retweet<br />retweet callback<br /><br />However, the followers never see it and when logging directly into that account on twitter, it doesn't show it as retweeted. What am I missing ? How do I debug this ?<br /><br />Thanks !<br />N2IChttps://www.blogger.com/profile/02451724066378205146noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-2933871434505103802012-12-18T21:03:57.420+00:002012-12-18T21:03:57.420+00:00Gotta love node.
tiny nit - the testForHashtag fu...Gotta love node.<br /><br />tiny nit - the testForHashtag function should probably do case insensitive matching. (e.g. using an "ig" regex)Ken Egozihttps://www.blogger.com/profile/05408953382642388888noreply@blogger.com