fedstoa / moa Goto Github PK
View Code? Open in Web Editor NEWA Mastodon, Twitter, and Instagram Cross-poster
Home Page: https://moa.party
License: MIT License
A Mastodon, Twitter, and Instagram Cross-poster
Home Page: https://moa.party
License: MIT License
So far so good, running Ubuntu 16.04 with python 3.5.2 (troubleshooting issues updating to 3.6). When i run app.py from the /moa user directory, i get the following syntax error. Some googling has not turned up a simple solution yet.
(.moa-venv) who@where:~/moa$ python app.py
File "app.py", line 88
app.logger.debug(f"Existing settings found: {enabled} {settings.__dict__}")
^
SyntaxError: invalid syntax
https://sentry.io/james-moore-p3/moa/issues/463164907/
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
File "instagram/bind.py", line 130, in _do_api_request
content_obj = simplejson.loads(content)
File "simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
InstagramClientError: (502) Unable to parse response, not valid JSON.
(1 additional frame(s) were not displayed)
...
File "python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "moa/worker.py", line 164, in <module>
recent_media, _ = api.user_recent_media(user_id=bridge.instagram_account_id)
File "instagram/bind.py", line 207, in _call
return method.execute()
File "instagram/bind.py", line 198, in execute
content, next_url = self._do_api_request(url, method, body, headers)
File "instagram/bind.py", line 132, in _do_api_request
raise InstagramClientError('Unable to parse response, not valid JSON.', status_code=response['status'])
InstagramClientError: (502) Unable to parse response, not valid JSON.
To prevent any tweet referencing twitter content from passing though.
https://sentry.io/james-moore-p3/moa/issues/403807870/
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
File "mastodon/Mastodon.py", line 1108, in __api_request
response = response_object.json(object_hook=self.__json_date_parse)
File "requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "json/__init__.py", line 367, in loads
return cls(**kw).decode(s)
File "json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
MastodonAPIError: Could not parse response as JSON, response code was 504, bad json content was 'b'<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n<meta content=\'text/html; charset=UTF-8\' http-equiv=\'Content-Type\'>\n<meta charset=\'utf-8\'>\n<title>This page is not correct\n - Mastodon</title>\n<meta content=\'width=device-width,initial-scale=1\' name=\'viewport\'>\n<link rel="stylesheet" media="all" href="/_maas/500.css" />\n</head>\n<body class=\'error\'>\n<div class=\'dialog\'>\n<img alt=\'Mastodon\' src=\'/_maas/oops.gif\'>\n<div>\n<h1>We're sorry, but something went wrong on our end.\n</h1>\n</div>\n</div>\n</body>\n</html>\n''
File "python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "moa/worker.py", line 64, in <module>
since_id=bridge.mastodon_last_id
File "mastodon/Mastodon.py", line 387, in account_statuses
return self.__api_request('GET', url, params)
File "mastodon/Mastodon.py", line 1113, in __api_request
response_object.content))
MastodonAPIError: Could not parse response as JSON, response code was 504, bad json content was 'b'<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n<meta content=\'text/html; charset=UTF-8\' http-equiv=\'Content-Type\'>\n<meta charset=\'utf-8\'>\n<title>This page is not correct\n - Mastodon</title>\n<meta content=\'width=device-width,initial-scale=1\' name=\'viewport\'>\n<link rel="stylesheet" media="all" href="/_maas/500.css" />\n</head>\n<body class=\'error\'>\n<div class=\'dialog\'>\n<img alt=\'Mastodon\' src=\'/_maas/oops.gif\'>\n<div>\n<h1>We're sorry, but something went wrong on our end.\n</h1>\n</div>\n</div>\n</body>\n</html>\n''
https://sentry.io/james-moore-p3/moa/issues/450587114/
AttributeError: 'NoneType' object has no attribute 'instagram_access_code'
(2 additional frame(s) were not displayed)
...
File "moa/app.py", line 394, in instagram_oauthorized
bridge.instagram_access_code = access_token[0]
AttributeError: 'NoneType' object has no attribute 'instagram_access_code'
Maybe track per-day averages and alert over a certain threshold?
Apparently it's against the rules to use automation to create replies and mentions. I'll make this a site option so people can choose do this or not depending on how risky they're feeling.
An opt-out checkbox for both services.
Also, there's an unexpanded handle here
So for instance you could only allow tweets from the Switch to pass through to Mastodon.
Hi,
I'm using other means to post to both Mastodon and Twitter, and my original posts are already synced. So I thought I'd use this tool (which btw looks great, good job!) to only post retweets back to Mastodon and perhaps boosts over to birdsite.
On the settings page it looks like that's actually possible. This is my current config:
However, it doesn't actually sync my retweets at the moment. Not sure if that's intended, or a bug.
Cheers
https://sentry.io/james-moore-p3/moa/issues/404132119/
Empty:
File "sqlalchemy/pool.py", line 1122, in _do_get
return self._pool.get(wait, self._timeout)
File "sqlalchemy/util/queue.py", line 145, in get
raise Empty
ConnectionRefusedError: [Errno 111] Connection refused
File "pymysql/connections.py", line 916, in connect
**kwargs)
File "python3.6/socket.py", line 724, in create_connection
raise err
File "python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
(11 additional frame(s) were not displayed)
...
File "sqlalchemy/engine/strategies.py", line 105, in connect
return dialect.connect(*cargs, **cparams)
File "sqlalchemy/engine/default.py", line 393, in connect
return self.dbapi.connect(*cargs, **cparams)
File "pymysql/__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "pymysql/connections.py", line 706, in __init__
self.connect()
File "pymysql/connections.py", line 963, in connect
raise exc
OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
(26 additional frame(s) were not displayed)
...
File "sqlalchemy/engine/strategies.py", line 105, in connect
return dialect.connect(*cargs, **cparams)
File "sqlalchemy/engine/default.py", line 393, in connect
return self.dbapi.connect(*cargs, **cparams)
File "pymysql/__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "pymysql/connections.py", line 706, in __init__
self.connect()
File "pymysql/connections.py", line 963, in connect
raise exc
OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
Hi! Just wanted to let y'all know that the "Split long toots on Twitter?" option ended up taking this from Mastodon and turning it into this truncated section without previous attached.
Also, may I suggest that such broken-up tweets be actually threaded as replies to yourself on Twitter?
Thanks for this!
things like new users add, tweets/toots delivered
Hi. I am a graphic designer. I volunteer to design a logo for open source projects. I can design it for you to use it in the readme file. What dou you say?
https://mastodon.social/@ldexterldesign/100435379111321491
Hi!
Hope you're well
Thanks for ๐ฅ software
As title
A dynamic template string giving me access to Mastodon URLs (e.g. profile, toot) would be amazing a la https://ifttt.com/applets/73077886 but I imagine this is a lot more work and could come later?
If you're reading this and agree please up-vote and/or reply +1
Let me know if you have any issues - happy to help
Hope this is clear/useful and to hear back
Keep up good work!
Yours hopefully
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.