Code Monkey home page Code Monkey logo

bitrise-giphy-step's People

Contributors

almouro avatar orestesgaolin avatar viktorbenei avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

bitrise-giphy-step's Issues

GIF_URL not exported

Has something changed with the Bitrise API? The GIF_URL seems to not be exported, see attached screenshot. Couldn't find any difference to other working plugins though.

bildschirmfoto 2018-11-07 um 13 59 39

ValueError, empty range for randrange()

Exception is being thrown when Bitrise step is executed.

Am using my own registered API key that returns results perfectly fine within Postman.

+------------------------------------------------------------------------------+
| (4) [email protected]                                                              |
+------------------------------------------------------------------------------+
| id: giphy                                                                    |
| version: 0.2.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2020-11-23T12:51:42+11:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
Traceback (most recent call last):
  File "/var/folders/gp/mm15yx614cg04by6xp_bh2240000gn/T/bitrise589296632/step_src/step.py", line 38, in <module>
    gif = getGif(gifName, apiKey)
  File "/var/folders/gp/mm15yx614cg04by6xp_bh2240000gn/T/bitrise589296632/step_src/step.py", line 30, in getGif
    return data[random.randint(0,len(data) - 1)]['images']['fixed_height']['url']
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 244, in randint
    return self.randrange(a, b+1)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 220, in randrange
    raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,0, 0)

Gifs are not related to keywords

Very often gifs returned from Giphy are not related to the keywords provided.
E.g. for keywords:

victory,success,congrats

I receive following gif:

image
image

Giphy step fails due to network error

I have Giphy step at the end of my workflow and it exits with following error:

+------------------------------------------------------------------------------+

| (2) giphy                                                                    |
+------------------------------------------------------------------------------+
| id: giphy                                                                    |
| version: 0.1.1                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2019-05-09T19:54:05Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Traceback (most recent call last):
  File "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise569362648/step_src/step.py", line 36, in <module>
    gif = getGif(gifName)
  File "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise569362648/step_src/step.py", line 31, in getGif
    data = getJson(baseUrl, queryParams)['data']
  File "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise569362648/step_src/step.py", line 15, in getJson
    response = urllib2.urlopen(url)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 429: Unknown Error
WARN[19:54:07] Step (giphy) failed, but was marked as skippable 

This is part of my workflow that is related to Giphy:

    - script:
        inputs:
        - content: |-
            #!/bin/bash
            set -e
            set -x

            if [ $BITRISE_BUILD_STATUS -eq 1 ]
              then envman add --key GIPHY_KEYWORDS --value "fail,disappointed,try again"
              else envman add --key GIPHY_KEYWORDS --value "success,congrats,victory"
            fi

            end=$(date +%s)
            let duration=end-BITRISE_BUILD_TRIGGER_TIMESTAMP
            echo $duration
    - giphy:
        inputs:
        - gif_words: "$GIPHY_KEYWORDS"

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.