Commit aba7cf77 authored by Lysander Trischler's avatar Lysander Trischler
Browse files

Also include own twts in conversation tree

parent 10abc64d
......@@ -5,9 +5,11 @@ Manage twts.
import collections
import shelve
import twtxt.models
import twtxt.parser
import twtxthash
import twtxtparser
class TwtxtManager:
def __init__(self):
......@@ -34,6 +36,10 @@ class TwtxtManager:
MAX_TWEETS_LIMIT = 500
self._cache = shelve.open('/home/lyse/.config/twtxt/cache')
own_source = twtxt.models.Source(nick="lyse", url="https://lyse.isobeef.org/twtxt.txt")
with open('/home/lyse/.config/twtxt/twtxt.txt', 'r', encoding='utf-8') as fd:
own_twts = twtxt.parser.parse_tweets(fd.readlines(), own_source)
self._cache[own_source.url] = {'tweets': own_twts}
self._cache2 = shelve.open('/home/lyse/.config/twtxt/cache2')
for url, feed in self._cache.items():
if url == "last_update":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment