Programming.Bots History

Hide minor edits - Show changes to output - Cancel

 
 
April 18, 2016, at 09:43 PM by MichaelPaulukonis -
Changed line 143 from:
TODO: try the @@get_tokens.js@@ tool from aparrish's [example-twitter-bot-node](https://github.com/aparrish/example-twitter-bot-node)
to:
TODO: try the @@get_tokens.js@@ tool from aparrish's [[https://github.com/aparrish/example-twitter-bot-node|example-twitter-bot-node]]
 
 
April 18, 2016, at 09:42 PM by MichaelPaulukonis -
Changed line 19 from:
!! Using Heroku
to:
!! Using Heroku
Added lines 143-145:
TODO: try the @@get_tokens.js@@ tool from aparrish's [example-twitter-bot-node](https://github.com/aparrish/example-twitter-bot-node)

Changed line 202 from:
[[WordSalad.TwitterBotProject]] - in which I write some (surprise!) Twitter bots. 
to:
[[WordSalad.TwitterBotProject]] - in which I write some (surprise!) Twitter bots.
 
 
January 25, 2016, at 01:00 PM by MichaelPaulukonis -
Changed lines 191-192 from:

to:
!!! alternative libraries
https://github.com/aparrish/example-twitter-bot-node/blob/master/get_tokens.js
https://www.npmjs.com/package/qauth


Changed line 208 from:
[[!Twitter]] [[!Bots]] [[!MicroBlogging]] [[!Automation]] [[!OAuth]] [[!Authentication]] [[!Heroku]] [[!Cloud]]
to:
[[!Twitter]] [[!Bots]] [[!MicroBlogging]] [[!Automation]] [[!OAuth]] [[!Authentication]] [[!Heroku]] [[!Cloud]]
 
 
July 21, 2015, at 04:03 PM by MichaelPaulukonis -
Added line 48:
* [[http://zachwhalen.net/posts/how-to-make-a-twitter-bot-with-google-spreadsheets-version-04|updated article]] - uses new OAuth script required by Twitter changes
 
 
April 01, 2015, at 10:42 PM by MichaelPaulukonis -
Added lines 180-182:
## or, edit the @@.env@@ file directly if you have it
### the @@ACCESS_TOKEN_@@ and @@ACCESS_TOKEN_SECRET@@ keys are the targets
### @@CONSUMER_KEY@@ and @@CONSUMER_KEY_SECRET@@ are the shared keys for the app
 
 
March 25, 2015, at 01:09 PM by MichaelPaulukonis -
Changed line 20 from:
* See Also [[WebDevelopment.Heroku]]
to:
* See Also [[WebDevelopment.Heroku#toc4|publishing a heroku app]]
 
 
March 18, 2015, at 10:41 PM by MichaelPaulukonis -
Changed lines 20-25 from:
See Also [[WebDevelopment.Heroku]]
Will need to initiate an app.
Install environment settings (no doubt) (see below)
copy the environment settings locally
create the @@Procfile@@ - which is probably (:source:)[@worker node index.js@]
run locally using @@foreman start worker@@
to:
* See Also [[WebDevelopment.Heroku]]
* Will need to initiate an app.
* Install environment settings (no doubt) (see below)
* copy the environment settings locally
* create the @@Procfile@@ - which is probably (:source:)[@worker node index.js@]
* run locally using @@foreman start worker@@
 
 
March 18, 2015, at 04:27 PM by MichaelPaulukonis - minutes and seconds
Changed line 177 from:
heroku config:set CONSUMER_KEY=foo CONSUMER_SECRET=bar ACCESS_TOKEN= ACCESS_TOKEN_SECRET= TWEET_ON=true LOG=true
to:
heroku config:set CONSUMER_KEY=foo CONSUMER_SECRET=bar ACCESS_TOKEN= ACCESS_TOKEN_SECRET= TWEET_ON=true LOG=true MINUTES=15 SECONDS=60
 
 
March 18, 2015, at 04:12 PM by MichaelPaulukonis - more notes on authentication with twurl, and working with heroku
Changed lines 19-45 from:
!!! Using Google Spreadsheet with apps script
to:
!! Using Heroku
See Also [[WebDevelopment.Heroku]]
Will need to initiate an app.
Install environment settings (no doubt) (see below)
copy the environment settings locally
create the @@Procfile@@ - which is probably (:source:)[@worker node index.js@]
run locally using @@foreman start worker@@

!!! Config file
In order to be able to commit to @@.git@@ and not put your actual auth-tokens into the file, use something like this:

(:source lang=javascript:)[@
module.exports = {
    consumer_key:        process.env.CONSUMER_KEY,
    consumer_secret:      process.env.CONSUMER_SECRET,
    access_token:        process.env.ACCESS_TOKEN,
    access_token_secret:  process.env.ACCESS_TOKEN_SECRET,

    // static_lib:          (process.env.STATIC_LIB.toLowerCase() === 'true'),
    tweet_on:            (process.env.TWEET_ON.toLowerCase() === 'true'),
    log:                  (process.env.LOG.toLowerCase() === 'true'),
    seconds:              parseInt(process.env.SECONDS, 60),
    minutes:              parseInt(process.env.MINUTES, 1)
};
@]

!! Using Google Spreadsheet with apps script
 
 
March 18, 2015, at 04:00 PM by MichaelPaulukonis -
Changed line 140 from:
## looks like @@https://api.twitter.com/oauth/authorize?oauth_consumer_key=foo&oauth_nonce=bar&oauth_signature=v4aJ5M45HSE%baz%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1426708098&oauth_token=quz&oauth_version=1.0@@
to:
## looks like (:source:)[@https://api.twitter.com/oauth/authorize?oauth_consumer_key=foo&oauth_nonce=bar&oauth_signature=v4aJ5M45HSE%baz%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1426708098&oauth_token=quz&oauth_version=1.0@]
 
 
March 18, 2015, at 04:00 PM by MichaelPaulukonis -
Changed line 140 from:
## looks like [@https://api.twitter.com/oauth/authorize?oauth_consumer_key=foo&oauth_nonce=bar&oauth_signature=v4aJ5M45HSE%baz%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1426708098&oauth_token=quz&oauth_version=1.0@]
to:
## looks like @@https://api.twitter.com/oauth/authorize?oauth_consumer_key=foo&oauth_nonce=bar&oauth_signature=v4aJ5M45HSE%baz%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1426708098&oauth_token=quz&oauth_version=1.0@@
Changed lines 147-148 from:

the [@.twurlc@] file was create for me in [@C:\users\<username>\@] - but if you have a [@HOME@] environment variable, it could be elsewhere.
to:
# get the new values from the @@.twurlc@@ file for your bot
##the
[@.twurlc@] file was create for me in [@C:\users\<username>\@] - but if you have a [@HOME@] environment variable, it could be elsewhere.
## Using Heroku? You'll need something like the following to set the env-vars:
###(:source:)[@
heroku config:set CONSUMER_KEY=foo CONSUMER_SECRET=bar ACCESS_TOKEN= ACCESS_TOKEN_SECRET= TWEET_ON=true LOG=true
@]
 
 
March 18, 2015, at 03:54 PM by MichaelPaulukonis -
Changed lines 130-137 from:
Go to [[http://apps.twitter.com]] and select the app.
Selects the @@Keys and Access Tokens@@ tabs.
Log out.
Log in to bot-account.
NOW do the command-line to authorize this account.

NOTE: I thought the application wasn't working because there was ''no prompt'' for the PIN.
There isn't any. Just start typing
.
to:
# Get access token
## Go to
[[http://apps.twitter.com]] and select the app.
## Select the @@Keys and Access Tokens@@ tabs.
## Log out.
## alternatively, you might them stored in Passpack or Keepass or something

# Log in to bot-account.
# do the command-line to authorize this account
## [@twurl authorize --consumer-key "[consumer-key]" --consumer-secret "[consumer-secret]"@]
# copy the URL provided
## looks like [@https://api
.twitter.com/oauth/authorize?oauth_consumer_key=foo&oauth_nonce=bar&oauth_signature=v4aJ5M45HSE%baz%253D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1426708098&oauth_token=quz&oauth_version=1.0@]
# paste into browser
# authorize the app
# enter the PIN back into the shell1
## NOTE: I thought the application wasn't working because there was ''no prompt'' for the PIN.
## There isn't any. Just start typing.
## @@twurl@@ seg-faults for me in @@cmder@@. At work, anyway. On lunch.

 
 
March 18, 2015, at 01:28 PM by MichaelPaulukonis - xrefs
Added lines 153-154:
[[MicroBlogging]]
[[http://michaelpaulukonis.com/Tags/Bots|posts tagged @@bots@@]] on @@michaelpaulukonis.com@@
 
 
February 18, 2015, at 09:35 PM by MichaelPaulukonis -
Changed lines 125-127 from:
I was able to use the techniques in [[http://dghubble.com/blog/posts/twitter-app-write-access-and-bots/|twitter app write access and bots]] after installing ruby. Can't find this functionality in naything else at the moment... More notes on [[http://thechangelog.com/twurl-oauth-enabled-curl-for-the-twitter-api/|twurl]]
to:
I was able to use the techniques in [[http://dghubble.com/blog/posts/twitter-app-write-access-and-bots/|twitter app write access and bots]] after installing ruby. Can't find this functionality in anything else at the moment... More notes on [[http://thechangelog.com/twurl-oauth-enabled-curl-for-the-twitter-api/|twurl]]

I... don't know where I installed ruby. It only appears at home as part of Heroku. so, I added that to the path. OK?
 
 
February 18, 2015, at 09:31 PM by MichaelPaulukonis -
Added lines 128-129:
Go to [[http://apps.twitter.com]] and select the app.
Selects the @@Keys and Access Tokens@@ tabs.
 
 
November 04, 2014, at 12:14 PM by MichaelPaulukonis -
Added lines 15-16:

[[http://blog.pezholio.co.uk/2012/06/make-your-own-food-safety-twitter-bot-with-scraperwiki-and-ifttt/|twitterbot with scraperwiki and IFTTT]]
 
 
October 30, 2014, at 02:35 PM by MichaelPaulukonis -
Added lines 129-132:

NOTE: I thought the application wasn't working because there was ''no prompt'' for the PIN.
There isn't any. Just start typing.
the [@.twurlc@] file was create for me in [@C:\users\<username>\@] - but if you have a [@HOME@] environment variable, it could be elsewhere.
 
 
October 30, 2014, at 12:51 PM by MichaelPaulukonis -
Added lines 124-128:

NOTE: capture the @@consumer-key@@ and @@consumer-secret@@ from the bot-application created under the main account (mine).
Log out.
Log in to bot-account.
NOW do the command-line to authorize this account.
 
 
October 30, 2014, at 12:44 PM by MichaelPaulukonis -
Added lines 122-124:

I was able to use the techniques in [[http://dghubble.com/blog/posts/twitter-app-write-access-and-bots/|twitter app write access and bots]] after installing ruby. Can't find this functionality in naything else at the moment... More notes on [[http://thechangelog.com/twurl-oauth-enabled-curl-for-the-twitter-api/|twurl]]

 
 
September 16, 2014, at 11:18 AM by MichaelPaulukonis -
Changed line 2 from:
[[#first]]
to:
Added lines 9-14:

[[http://www.technologyreview.com/view/529461/how-to-spot-a-social-bot-on-twitter/|How to spot a Social Bot on Twitter]] (2014.06)
[[http://www.newscientist.com/article/mg22329804.000-twitter-bots-grow-up-and-take-on-the-world.html#.VBhRJWN0slQ|Twitter bots grow up and take on the world]] (2014.08)


[[http://www.hastac.org/blogs/merylalper/2014/01/21/bot-i-never-thought-it-would-happen-me|bot impersonation]] - identity ''theft'' ?
 
 
September 16, 2014, at 09:04 AM by MichaelPaulukonis - more underscore templates
Changed line 56 from:
!! Underscore.js stuff
to:
!! Underscore.js stuff (for templating)
Added lines 61-82:

[[http://underscorejs.org/#template]] - official docs

>>blockq<<
Everything you need to know about underscore template is [[http://underscorejs.org/#template|here]]. Only 3 things to keep in mind:

    <% %> - to execute some code
    <%= %> - to print some value in template
    <%- %> - to print some values with HTML escaped

That's all about it.

Simple example:

[@var tpl = _.template("<h1>Some text: <%= foo %></h1>");@]

then [@tpl({foo: "blahblah"})@] would be rendered to the string [@<h1>Some text: blahblah</h1>@]

->([[http://stackoverflow.com/a/7241760/41153|source]])
>><<

 
 
September 16, 2014, at 08:59 AM by MichaelPaulukonis - some underscore resources
Changed lines 58-62 from:
to:
[[http://code.tutsplus.com/tutorials/best-practices-when-working-with-javascript-templates--net-28364|Best Practices When Working With JavaScript Templates]]
[[http://code.tutsplus.com/tutorials/getting-cozy-with-underscore-js--net-24581|Getting cozy with underscore.js]]
[[http://www.developerdrive.com/2012/04/an-introduction-to-underscore-js-%E2%80%93-part-1-arrays/|An introduction to underscore.js]]

TODO: move this to a dedicated page in [[WebDevelopment]]
 
 
September 15, 2014, at 02:21 PM by MichaelPaulukonis -
Changed line 33 from:
[[https://github.com/dariusk/NaNoGenMo/issues/14]] - ''why did I think this was relevant?''
to:
[[https://github.com/dariusk/rapbot]]
 
 
September 12, 2014, at 01:18 PM by MichaelPaulukonis -
Added lines 55-58:

!! Underscore.js stuff
[[http://braddunbar.net/2013/08/19/underscore-templates/]]

 
 
September 12, 2014, at 01:09 PM by MichaelPaulukonis -
Added lines 55-58:

!! Using Wordnik for bots
See [[Wordnik]]
See [[https://github.com/dariusk/rapbot/blob/master/rapbot.js]] which uses multiple calls.
 
 
September 11, 2014, at 11:03 PM by MichaelPaulukonis - consumer vs api
Added lines 82-86:

!!! Consumer Key? Consumer Secret?
I don't know why it's called that in every blasted articled I've read, since Twitter (as of 2014.08) calls it the @@API Key@@ and @@API Secret@@

Go figure.
 
 
September 11, 2014, at 12:32 PM by MichaelPaulukonis - example of bot template usage
Added lines 36-37:
** example code @ [[https://github.com/dariusk/4myrealfriends/blob/github/index.js]]
** uses [[https://www.npmjs.org/package/underscore.deferred|underscore.deferred]]
 
 
September 11, 2014, at 12:27 PM by MichaelPaulukonis - tags, resources refactored from WordSalad.TwitterBotProject
Added lines 11-82:
!!! Using Google Spreadsheet with apps script
[[http://zachwhalen.net/blog/13/nov/using-google-spreadsheets-generated-text-twitter-bot|Using Google Spreadsheets for a generated text Twitter bot]]
* [[https://docs.google.com/spreadsheet/ccc?key=0ApsYio1YzM56dFdzQ085VWRZNVJYZjlkclA0YzFhVFE#gid=1|my (unmodified?) copy]]
* [[https://docs.google.com/spreadsheet/ccc?key=0ApsYio1YzM56dFpVQ2lTWlRyWnRub1d2VTFuTkhMMWc#gid=0|solanasbot01 variant]] (private to me)
** the "first" variation used the original code, but with a single row of apx 20 sentences.
** Second variant had a single column, and modified code (which I should document).
* NOTE: scripts (of at least this kind) will continue running on the Google server, even after the spreadsheet/script browser-tabs are closed.

[[http://www.kahero.net/creating-twitter-bot-using-google-app-script/]]

[[https://developers.google.com/apps-script/|google docs on apps-script]]
* [[https://developers.google.com/apps-script/articles|tutorials]]
* [[Wikipedia:Google_Apps_Script]]

!!! Darius Kazemi sources
[[http://tinysubversions.com/2013/09/how-to-make-a-twitter-bot/|How to make a Twitter Bot]]
** [[https://github.com/dariusk/examplebot]]
** [[https://www.helpkidscode.com/how-to-make-a-twitter-bot/|variant version of article]]
[[http://tinysubversions.com/2012/05/how-i-built-metaphor-a-minute/|How I built metaphor-a-minute]]
** [[https://github.com/dariusk/metaphor-a-minute]]
[[https://github.com/dariusk/twoheadlines]]
[[http://tinysubversions.com/twoheadlines/docs/]]
[[https://github.com/dariusk/NaNoGenMo/issues/14]] - ''why did I think this was relevant?''

[[https://github.com/dariusk/grunt-init-twitter-bot|twitter-bot starter-kit]] - using @@grunt-init@@

!!! Other resources
[[http://blog.tullyhansen.com/post/62774813528/fake-it-til-you-make-it-a-basic-bot-primer-for-the]]

[[http://dghubble.com/blog/posts/twitter-app-write-access-and-bots/]]

[[http://www.kcoleman.me/blog/2014/06/01/twitter-bot-on-heroku/|twitter bot on heroku]]

[[https://github.com/zwass/heroku-twitterbot-starter]] - python
[[http://readwrite.com/2014/06/20/random-non-sequitur-twitter-bot-instructions|Five Steps To Build Your Own Random Non-Sequitur Twitter Bot]]
** uses [[https://github.com/tommeagher/heroku_ebooks|heroku_ebooks]] repo (python)

[[http://www.apcoder.com/2013/10/03/twitter-bot-20-minutes-node-js/|A Twitter Bot in 20 Minutes With Node.js]]

[[http://tinysubversions.com/2013/03/basic-twitter-bot-etiquette/|Basic Twitter-bot Etiquette]]

scrub output for "bad" words: [[https://github.com/dariusk/wordfilter]]


!! editing the text
Split into sentences
sorted by length

[@http://txt.binnyva.com/2009/04/sort-by-line-length/@]

[@cat /etc/passwd | awk '{print length, $0}' | sort -n | awk '{$1=""; print $0 }'@]
Didn't work on my windows system, but [@cat | awk | <file>@] worked, so then I fired it up in Emacs, where [[http://www.gnu.org/software/emacs/manual/html_node/elisp/Sorting.html|[@sort-numeric-fields@]]] did the trick. I then deleted the numbers at the front of each line: [@^[0-9]*\s-@]
Well, I also only selected the lines that had < 140 chars.

Could do this "easier" in a node.js script.
Will look into it.
Or in emacs, I suppose....


!! [[#auth]]Auth Issues
I ran into some authentication issues and.... I'm still not sure how I resolved them. Initially, on Wednesday, I couldn't get the app set to do read+write, said I needed a mobile phone, and twitter would crash when I tried to add one (I think because my mobile number is already connected an account. My _real_ one).

Anyway. Later on it worked, without prompting for mobile.
Second bot had no issues.

Third bot had the auth troubles again -- insisted I need a mobile.
Ultimately, I deleted the mobile from my main account and added it to the bot so I could authenticate.
Then I deleted the mobile and re-added it to my profile.
UGH


Changed line 85 from:
[[WordSalad.TwitterBotProject]] - in which I write some (surprise!) Twitter bots. And have a bunch of resources that should be in here.
to:
[[WordSalad.TwitterBotProject]] - in which I write some (surprise!) Twitter bots.
Changed lines 91-92 from:
!! Category tags
to:
!! Category tags
[[!Twitter]] [[!Bots]] [[!MicroBlogging]] [[!Automation]] [[!OAuth]] [[!Authentication]] [[!Heroku]] [[!Cloud]]
 
 
September 09, 2014, at 12:44 PM by MichaelPaulukonis -
Changed lines 3-5 from:
!! First heading

to:
!! Link Dump
Added lines 8-10:
[[http://www.theguardian.com/technology/2014/aug/05/wikipedia-meet-the-man-who-has-edited-3m-articles|Wikipedia: meet the man who has edited 3m articles]] - because he's written editing bots.

Added lines 13-15:
[[WordSalad.TwitterBotProject]] - in which I write some (surprise!) Twitter bots. And have a bunch of resources that should be in here.
[[WordSalad.AutomaticForThePeople]]
[[WordSalad.WritingMachines]]
 
 
December 02, 2013, at 08:53 AM by OtherMichael -
Added lines 1-14:
(:description semi-autonomous agents :)
[[#first]]
!! First heading


[[http://tinysubversions.com/2013/11/bot-summit/|bot summit]]
[[http://www.crummy.com/2013/11/27/0]]

[[#seealso]]
!! See Also


[[#tags]] [[#categories]]
!! Category tags