omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Gmail API and Pythonista

    Pythonista
    4
    5
    3722
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gauden
      gauden last edited by

      Now that the Gmail API is released it seemed to me to be a good way to further break down the barriers between Pythonista and the outside world.

      I have previously used the imbox project within Pythonista with great success as a means of reading and writing structured data from emails.

      I wonder, has anyone managed to get the Gmail API working? It seems to me to be a promising and convenient step forward. I have tried the following:

      1. I loaded the Python API client library into a Pythonista project
      2. I registered a project on the Google Developers' Console, created credentials, and downloaded the relevant JSON creds data to the project
      3. I ran the sample script on the quickstart page
      4. I encountered an error relating to gflags -- so I downloaded and incorporated that library.

      At this stage the sample script crashes with an error that contains no clue as to what is missing (at least to one who is not familiar with what gflags is doing).

      Hence this post: has anyone got it working?

      1 Reply Last reply Reply Quote 0
      • midas9087
        midas9087 last edited by

        quickstart.py attempts to open a web site (https://accounts.google.com...). A new tab opens in Console to get to the web site, but I get an error:

        403. That's an error.
        Error: disallowed_useragent
        Google can't sign you in safely inside this app. You can use Google sign-in by visiting this app’s website in a browser like Safari or Chrome.
        

        Is there a way to fix this so that the web site can open from within Pythonista?

        mikael 1 Reply Last reply Reply Quote 0
        • mikael
          mikael @midas9087 last edited by

          @midas9087, you can allow ”unsafe browsers” from Google settings, if I recall correctly. Unsafeness had maybe something to with SSL/TLS versions.

          1 Reply Last reply Reply Quote 0
          • midas9087
            midas9087 last edited by

            I already allowed unsafe browsers on my Google account (via Google settings).

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              It is a user agent thing. Webvuews are not allowed to use the auth, since the containing app could steal your login info. They want you using the actual objc api's.

              You can get around this, i think by changing the user agent. There was a thread recently on that topic. You would have to modify the quickstart script to use a modified webview.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors