Programming.Bots History

Hide minor edits - Show changes to markup - 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 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:
to:
 
 
July 21, 2015, at 04:03 PM by MichaelPaulukonis -
Added line 48:
  • updated article - uses new O Auth? script required by Twitter changes
 
 
April 01, 2015, at 10:42 PM by MichaelPaulukonis -
Added lines 180-182:
  1. or, edit the .env file directly if you have it
    1. the ACCESS_TOKEN_ and ACCESS_TOKEN_SECRET keys are the targets
    2. 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:
to:
 
 
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:
  1. 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:
  1. 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:
  1. 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:
  1. 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:
  1. get the new values from the .twurlc file for your bot
    1. the .twurlc file was create for me in C:\users\<username>\ - but if you have a HOME environment variable, it could be elsewhere.
    2. Using Heroku? You’ll need something like the following to set the env-vars:
      1. (: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:
  1. Get access token
    1. Go to http://apps.twitter.com and select the app.
    2. Select the Keys and Access Tokens tabs.
    3. Log out.
    4. alternatively, you might them stored in Passpack or Keepass or something

 

  1. Log in to bot-account.
  2. do the command-line to authorize this account
    1. twurl authorize --consumer-key "[consumer-key]" --consumer-secret "[consumer-secret]"
  3. copy the URL provided
    1. 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
  4. paste into browser
  5. authorize the app
  6. enter the PIN back into the shell1
    1. NOTE: I thought the application wasn’t working because there was no prompt for the PIN.
    2. There isn’t any. Just start typing.
    3. 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
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 twitter app write access and bots after installing ruby. Can’t find this functionality in naything else at the moment... More notes on twurl

to:

I was able to use the techniques in twitter app write access and bots after installing ruby. Can’t find this functionality in anything else at the moment... More notes on 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:

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 twitter app write access and bots after installing ruby. Can’t find this functionality in naything else at the moment... More notes on twurl

 
 
September 16, 2014, at 11:18 AM by MichaelPaulukonis -
Changed line 2 from:

to:
Added lines 9-14:

How to spot a Social Bot on Twitter (2014.06)
Twitter bots grow up and take on the world (2014.08)

 

 

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

 

Everything you need to know about underscore template is 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>

 

(source)

 

 
 
September 16, 2014, at 08:59 AM by MichaelPaulukonis - some underscore resources
Changed lines 58-62 from:
to:

Best Practices When Working With JavaScript Templates
Getting cozy with underscore.js
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 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

Using Google Spreadsheets for a generated text Twitter bot

  • my (unmodified?) copy
  • 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/

 

google docs on apps-script

 

Darius Kazemi sources

How to make a Twitter Bot

  • https://github.com/dariusk/examplebot
  • variant version of article

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?

 

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/

 

twitter bot on heroku

 

https://github.com/zwass/heroku-twitterbot-starter - python
Five Steps To Build Your Own Random Non-Sequitur Twitter Bot

  • uses heroku_ebooks repo (python)

 

A Twitter Bot in 20 Minutes With Node.js

 

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 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 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:
 
 
September 09, 2014, at 12:44 PM by MichaelPaulukonis -
Changed lines 3-5 from:

First heading

 

to:

Link Dump

Added lines 8-10:

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 heading

 

 

bot summit
http://www.crummy.com/2013/11/27/0

 

See Also

 

 

Category tags