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
Post a Comment