• davenicholls149

    @johnbenallan

    You're right, the four scripts all reference the original one so it must be called gistcheck.py. I picked this up from an earlier comment, but I have now added it as a comment to my fork of the original.

    I followed the convention of this thread and posted the shorter, anonymous, gist link although it does end up being redirected to my account so it doesn't remain anonymous.

    On my iPad I use a slightly modified version of the script, the lines:

    if message is not None: payload['description'] = message
    for f, c in files.items():
        payload['files'][os.path.basename(f)] = {"content":c}
    

    are replaced by

    if message is not None: payload['description'] = message
    payload['public'] = False
    for f, c in files.items():
        payload['files'][os.path.basename(f)] = {"content":c}'
    

    Which creates a private gist.

    Dave

    posted in Pythonista read more
  • davenicholls149

    Thanks,

    I grabbed spencerogden's because I wanted the ability to create a new gist. I've therefore done a simple hack and used Westacular's auth() function in spencerogdon's version. I haven't done extensive testing, but it seems to work fine.

    It's available here:

    https://gist.github.com/5212628

    Cheers

    Dave

    posted in Pythonista read more
  • davenicholls149

    Hi,

    I'm havign a problem getting this to work. I've grabbed spencerogden's gist and run it as described. This gives me the four scripts.

    I then tried to create a new file and commit it (as a new gist). When I try to do so it fails at the authorisation phase with the error:

    "An error occurred while running the action 'Gist Commit': KeyError:'token'"

    When I look at the return from the call to auth() I see:

    {u'message': u'Not Found'}

    which explains why I get the key error, but doesn't explain why I would get that return.

    I have tried random credentials and this gives a different error (sensibly related to bad credentials)

    I noticed one possible issue in the auth() function, I think there may be a problem with the call to api_url.replace

    It replaces 'gist' with 'authorizations' which, given the original url will make the end of the subsequent url:

    /authorizationss/

    with an extra 's'

    However, correcting this makes no difference.

    What am I missing?

    Thanks

    Dave

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!