how can i use ruby and twitter tweet from text file -


i'm trying tweet text file without getting symbols.

my tweets looks like: ["this sample of tweet on twitter"\n] << includes symbols , "n".

what i'm trying is: sample of want tweet like. << no symbols.

my code:

def tweet   file = file.open("tweets_from.txt","r")   read = file.readlines.sample(1)   client.update("#{read}").text end  tweet 

thanks in advance :)

it enough change

read = file.readlines.sample(1) 

to this:

read = file.readlines.sample.chomp 

more method (and many other!) here: ruby string docs


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -