<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>jodi</title>
  <link>https://jodi.dreamwidth.org/</link>
  <description>jodi - Dreamwidth Studios</description>
  <lastBuildDate>Wed, 02 Mar 2011 10:29:46 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>jodi</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/344476/152029</url>
    <title>jodi</title>
    <link>https://jodi.dreamwidth.org/</link>
    <width>100</width>
    <height>75</height>
  </image>

<item>
  <guid isPermaLink='true'>https://jodi.dreamwidth.org/4786.html</guid>
  <pubDate>Wed, 02 Mar 2011 10:29:46 GMT</pubDate>
  <title>Twitter bot</title>
  <link>https://jodi.dreamwidth.org/4786.html</link>
  <description>I decided to start learning Python by creating a Twitter bot. I have an online diary, that I have been keeping for over a decade now, and I decided that I would output lines from it as tweets, so that I could keep in touch with my younger self. If you want to see it in action: &lt;a href=&quot;http://www.twitter.com/echochild&quot;&gt;Echochild&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;cut-wrapper&quot;&gt;&lt;span style=&quot;display: none;&quot; id=&quot;span-cuttag___1&quot; class=&quot;cuttag&quot;&gt;&lt;/span&gt;&lt;b class=&quot;cut-open&quot;&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class=&quot;cut-text&quot;&gt;&lt;a href=&quot;https://jodi.dreamwidth.org/4786.html#cutid1&quot;&gt;Things I found odd to start with in Python&lt;/a&gt;&lt;/b&gt;&lt;b class=&quot;cut-close&quot;&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;display: none;&quot; id=&quot;div-cuttag___1&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;There are quite a few Python to Twitter packages, but in the end, I decided upon &lt;a href=&quot;https://github.com/joshthecoder/tweepy&quot;&gt;Tweepy&lt;/a&gt;.&lt;span class=&quot;cut-wrapper&quot;&gt;&lt;span style=&quot;display: none;&quot; id=&quot;span-cuttag___2&quot; class=&quot;cuttag&quot;&gt;&lt;/span&gt;&lt;b class=&quot;cut-open&quot;&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class=&quot;cut-text&quot;&gt;&lt;a href=&quot;https://jodi.dreamwidth.org/4786.html#cutid2&quot;&gt;Installing Tweepy&lt;/a&gt;&lt;/b&gt;&lt;b class=&quot;cut-close&quot;&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;display: none;&quot; id=&quot;div-cuttag___2&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I formatted the diary entries, using Vi, so that there is just one sentence per line.&lt;br /&gt;&lt;br /&gt;I got the appropriate authorisation tokens from Twitter: consumer token, consumer secret, etc.&lt;br /&gt;&lt;br /&gt;Due to access restrictions, I am unable to run cron jobs or leave things running in the background, so concluded that being able to tweet just by going to a web page would do. Not quite automatic, but still, will do for now.&lt;br /&gt;&lt;br /&gt;I then created a CGI script in the joshthecoder-tweepy-fcaff74 directory.&lt;span class=&quot;cut-wrapper&quot;&gt;&lt;span style=&quot;display: none;&quot; id=&quot;span-cuttag___3&quot; class=&quot;cuttag&quot;&gt;&lt;/span&gt;&lt;b class=&quot;cut-open&quot;&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class=&quot;cut-text&quot;&gt;&lt;a href=&quot;https://jodi.dreamwidth.org/4786.html#cutid3&quot;&gt;CGI script&lt;/a&gt;&lt;/b&gt;&lt;b class=&quot;cut-close&quot;&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;display: none;&quot; id=&quot;div-cuttag___3&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The next thing to do is make it actually reply to people!&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=jodi&amp;ditemid=4786&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://jodi.dreamwidth.org/4786.html</comments>
  <category>python</category>
  <category>twitter</category>
  <category>bot</category>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
</channel>
</rss>
