mirror of https://gitlab.com/bashrc2/epicyon
Like a post
parent
1f366d27cf
commit
33077ab8df
|
@ -67,8 +67,8 @@ def announcePublic(baseDir: str,federationList: [],username: str, domain: str, p
|
||||||
ccUrl = prefix + '://'+fromDomain+'/users/'+username+'/followers'
|
ccUrl = prefix + '://'+fromDomain+'/users/'+username+'/followers'
|
||||||
return createAnnounce(baseDir,username, domain, port,toUrl, ccUrl, https, objectUrl, saveToFile)
|
return createAnnounce(baseDir,username, domain, port,toUrl, ccUrl, https, objectUrl, saveToFile)
|
||||||
|
|
||||||
def repeatMessage(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, announceUsername: str, announceDomain: str, announcePort: int, announceStatusNumber: int, announceHttps: bool, saveToFile: bool) -> {}:
|
def repeatPost(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, announceUsername: str, announceDomain: str, announcePort: int, announceStatusNumber: int, announceHttps: bool, saveToFile: bool) -> {}:
|
||||||
"""Repeats a given status message
|
"""Repeats a given status post
|
||||||
"""
|
"""
|
||||||
prefix='https'
|
prefix='https'
|
||||||
if not announceHttps:
|
if not announceHttps:
|
||||||
|
|
17
like.py
17
like.py
|
@ -10,7 +10,7 @@ import json
|
||||||
import commentjson
|
import commentjson
|
||||||
from utils import urlPermitted
|
from utils import urlPermitted
|
||||||
|
|
||||||
def like(baseDir: str,federationList: [],username: str, domain: str, port: int,toUrl: str, ccUrl: str, https: bool,objectUrl: str, saveToFile: bool) -> {}:
|
def like(baseDir: str,federationList: [],username: str,domain: str,port: int,toUrl: str,ccUrl: str,https: bool,objectUrl: str,saveToFile: bool) -> {}:
|
||||||
"""Creates a like
|
"""Creates a like
|
||||||
Typically toUrl will be a followers collection
|
Typically toUrl will be a followers collection
|
||||||
and ccUrl might be a specific person whose post was liked
|
and ccUrl might be a specific person whose post was liked
|
||||||
|
@ -42,3 +42,18 @@ def like(baseDir: str,federationList: [],username: str, domain: str, port: int,t
|
||||||
domain=domain.split(':')[0]
|
domain=domain.split(':')[0]
|
||||||
# TODO update likes collection
|
# TODO update likes collection
|
||||||
return newLike
|
return newLike
|
||||||
|
|
||||||
|
def likePost(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, likeUsername: str, likeDomain: str, likePort: int, likeStatusNumber: int, likeHttps: bool,saveToFile: bool) -> {}:
|
||||||
|
"""Likes a given status post
|
||||||
|
"""
|
||||||
|
prefix='https'
|
||||||
|
if not likeHttps:
|
||||||
|
prefix='http'
|
||||||
|
|
||||||
|
likeDomain=likeDomain
|
||||||
|
if likePort!=80 and likePort!=443:
|
||||||
|
likeDomain=likeDomain+':'+str(likePort)
|
||||||
|
|
||||||
|
objectUrl = prefix + '://'+likeDomain+'/users/'+likeUsername+'/statuses/'+str(likeStatusNumber)
|
||||||
|
|
||||||
|
return like(baseDir,federationList,username,domain,port,toUrl,ccUrl,https,objectUrl,saveToFile)
|
||||||
|
|
Loading…
Reference in New Issue