Closed porglezomp closed 9 years ago
File should save as karma.txt
to conform with the precedent set in #18.
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?
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]
.
This fixed it, thank you.
Convinced I added it. Just testing to make sure it's verbose enough.
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?
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?
We can close this one, I'm opening up other issues for adding other things into the twitter description.
:+1:
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.