fixed security bug
parent
4e4c836705
commit
c8d8bd7a64
|
@ -21,11 +21,12 @@ class Tooter(Mastodon):
|
|||
hostname: str = ''
|
||||
|
||||
def __init__(self, name: str):
|
||||
cred_dict = self.credentials[name]
|
||||
self.name = name
|
||||
cred_dict = self.credentials[self.name]
|
||||
self.username = cred_dict['addr']
|
||||
self.password = cred_dict['pass']
|
||||
self.client_id = f'.toota-palooza.env'
|
||||
self.cred_file = f'.toota-palooza-usercred-{name}.env'
|
||||
self.cred_file = f'.toota-palooza-usercred-{self.name}.env'
|
||||
|
||||
super().__init__(client_id=self.client_id, api_base_url=self.hostname)
|
||||
|
||||
|
@ -104,7 +105,8 @@ def daemon_main(tooter: Tooter):
|
|||
|
||||
def once(tooter: Tooter):
|
||||
"""Run from a command line."""
|
||||
message = check_public_timeline(tooter)
|
||||
# message = check_public_timeline(tooter)
|
||||
message = f'{tooter.name} says hi!'
|
||||
tooter.toot(message)
|
||||
return 0
|
||||
|
||||
|
@ -122,8 +124,9 @@ def main():
|
|||
Tooter.load_credentials(args.file)
|
||||
|
||||
if args.once:
|
||||
t = Tooter('nick')
|
||||
once(t)
|
||||
for name in Tooter.credentials:
|
||||
t = Tooter(name)
|
||||
once(t)
|
||||
return 0
|
||||
|
||||
daemon_main(t)
|
||||
|
|
Loading…
Reference in New Issue