yasoob / Reddit-Twitter-bot

This bot copies posts from /r/Python from Reddit and posts them to Twitter while keeping every safety measure in check.
9 stars 5 forks source link

updated readme and added some comments to the script #2

Closed zakagan closed 8 years ago

zakagan commented 8 years ago

Hi Yasoob!

Ok, I finally got around to updating the README. Feel free to take it from here! Again, it's a cool project and I'm glad I got to help out!

Best, Zach

yasoob commented 8 years ago

Thank you very much :)

zakagan commented 8 years ago

That was a suggestion given to me from someone on reddit, actually. The issue with file.readlines() is that it will give you the newline at the end of the string, while file.read().splitlines() will remove it.

The ID gathered from the reddit post object doesn't have the newline. So, It's good to separate it out. Maybe something like file.readlines()[:-1] is better? I'm not sure which way is more "pythonic".

There's another issue that I've found while working with twitter bots: there can sometimes be an extra space before the end of a shortened link, before the ellipses char. It's weird, I think it's Twitter's issue. Here's a post I made about it, and where I got some feedback about the bot: https://www.reddit.com/r/RequestABot/comments/4arcad/help_a_phantom_char_haunts_my_reddittwitter_bot/

Let me know what you think :)

Best, Zach

On Mon, Mar 28, 2016 at 1:43 PM, M.Yasoob Ullah Khalid ☺ < notifications@github.com> wrote:

Thank you very much :)

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/yasoob/Reddit-Twitter-bot/pull/2#issuecomment-202524744