Giter VIP home page Giter VIP logo

moa's People

Contributors

bmann avatar dependabot[bot] avatar flancian avatar foozmeat avatar jamespanic avatar muellermartin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

moa's Issues

Invalid syntax at line 88 app.py

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

InstagramClientError: (502) Unable to parse response, not valid JSON.

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.

wrap status fetching in try/except

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&#39;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&#39;re sorry, but something went wrong on our end.\n</h1>\n</div>\n</div>\n</body>\n</html>\n''

Optionally disable creating twitter mentions

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.

Post only retweets 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:

screenshot from 2017-11-24 12-00-00

However, it doesn't actually sync my retweets at the moment. Not sure if that's intended, or a bug.

Cheers

Add some handling in case mysql is down.

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)")

Logo

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?

As a user I want to add a prefix/suffix string into every federated post #Feature #Idea

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.