powderblock / DealWithItReddit

Reddit bot. Computer vision for facial detection and transformation. Python, PRAW, & OpenCV.
http://www.reddit.com/user/DealWithItbot/
MIT License
33 stars 3 forks source link

Update @DealtWithItBot's twitter status to contain the current karma value #26

Closed porglezomp closed 9 years ago

porglezomp commented 9 years ago

Perhaps do it once per day, and also list how much karma you gained that day?

Also, it's probably a good idea to keep a log file of karma values + timestamps.

powderblock commented 9 years ago

File should save as karma.txt to conform with the precedent set in #18.

powderblock commented 9 years ago

Something about how it's only getting first character. lines = [line.strip(',')[0] for line in open('karma.txt')] print lines

Resulting in ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1']. It's only on that line or something?

porglezomp commented 9 years ago

You're looking for .split not .strip, .strip returns a string without the character at the ends. Since you get the string, you're grabbing the first character of the string with your [0].

powderblock commented 9 years ago

This fixed it, thank you.

powderblock commented 9 years ago

Convinced I added it. Just testing to make sure it's verbose enough.

powderblock commented 9 years ago

This is added.

The twitter account shows last karma. But I don't know how I would implement karma since last day. I need to limit the karma saving or similar.
Currently the bot saves karma at the beginning of the file. Which I honestly like better because it will show karma spikes throughout the day. But that means calculating growth in that last day would require hard parsing on karma.txt?

Maybe you can take this one @porglezomp?

porglezomp commented 9 years ago

Hm, sounds like a fun short project, but as always I have the issue that I can't easily test it. Perhaps if you could provide me an example karma.txt I could write the code?

porglezomp commented 9 years ago

We can close this one, I'm opening up other issues for adding other things into the twitter description.

powderblock commented 9 years ago

:+1: