Fix getting posts

master
Bob Mottram 2019-07-03 11:33:55 +01:00
parent 27858b70e9
commit 553349c3f2
2 changed files with 8 additions and 6 deletions

View File

@ -82,6 +82,12 @@ if args.testsnetwork:
testPostMessageBetweenServers()
sys.exit()
if args.posts:
nickname=args.posts.split('@')[0]
domain=args.posts.split('@')[1]
getPublicPostsOfPerson(nickname,domain)
sys.exit()
if not args.domain:
print('Specify a domain with --domain [name]')
sys.exit()
@ -100,10 +106,4 @@ federationList=[]
if args.federationList:
federationList=args.federationList.copy()
if args.posts:
nickname=args.posts.split('@')[0]
domain=args.posts.split('@')[1]
getPublicPostsOfPerson(nickname,domain)
sys.exit()
runDaemon(domain,port,https,federationList,useTor)

View File

@ -22,6 +22,7 @@ from cache import storePersonInCache
from cache import getPersonFromCache
from pprint import pprint
from random import randint
from session import createSession
from session import getJson
from session import postJson
from webfinger import webfingerHandle
@ -541,6 +542,7 @@ def getPublicPostsOfPerson(nickname,domain):
""" This is really just for test purposes
"""
useTor=True
port=443
session = createSession(domain,port,useTor)
personCache={}
cachedWebfingers={}