Giter Site home page Giter Site logo

itunes-connect-slack's Introduction

itunes-connect-slack

These scripts fetch app info directly from iTunes Connect and posts changes in Slack as a bot. Since iTC doesn't provide event webhooks, these scripts use polling with the help of Fastlane's Spaceship.

Set up

Environment Variables

These scripts read specific values from the bash environment. Be sure to set these to the appropriate values:

export BOT_API_TOKEN="xoxb-asdfasdfasfasdfasdfsd" # The API Token for your bot, provided by Slack
export itc_username="[email protected]" # The email you use to log into iTunes Connect
export itc_team_id=77416800,77416801 # specify itunes team ids if user has an access to multiple ones (comma separated)
export bundle_id="com.best.app" # The bundle ID of the app you want these scripts to check

Install node modules

sudo gem install fastlane
npm install @slack/[email protected] --save
npm install dirty --save
npm install moment --save

Store your iTunes Connect password

You can use Fastlane's CredentialsManager to store your password. Enter this command and it will prompt you for your password:

fastlane fastlane-credentials add --username [email protected]

Channel info

Set the specific channel you'd like the bot to post to in post-update.js. By default, it posts to #ios-app-updates.

Polling interval

In poll-itc.js, set the pollIntervalSeconds value to whatever you like.

Running the scripts

node poll-itc.js

Or you can use the forever tool to keep it up indefinitely:

forever start poll-itc.js

Files

get-app-status.rb

Ruby script that uses Spaceship to connect to iTunes Connect. It then stdouts a JSON blob with your app info. It only looks for apps that aren't yet live.

poll-itc.js

Node script to invoke the ruby script at certain intervals. It uses a key/value store to check for changes, and then invokes post-update.js.

post-update.js

Node script that uses Slack's node.js SDK to send a message as a bot. It also calculates the number of hours since submission.

itunes-connect-slack's People

Contributors

erikvillegas avatar radekstasiak avatar rokkit 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  avatar  avatar  avatar

itunes-connect-slack's Issues

error

hello
i have an error:

Fetching latest app status...
util.js:1084
throw new errors.TypeError(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "last argument" argument must be of type function
at implementation (util.js:1084:13)
at WebClient.apiCall (/root/itunes-connect-slack/node_modules/@slack/client/dist/WebClient.js:384:47)
at Object.postToSlack [as slack] (/root/itunes-connect-slack/post-update.js:21:14)
at /root/itunes-connect-slack/poll-itc.js:22:15
at ChildProcess.exithandler (child_process.js:267:7)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

Parse error with the latest fastlane

Traceback (most recent call last):
        15: from get-app-status.rb:15:in `<main>'
        14: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/tunes/spaceship.rb:24:in `login'
        13: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/client.rb:346:in `login'
        12: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/client.rb:384:in `login'
        11: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/client.rb:753:in `do_login'
        10: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/tunes/tunes_client.rb:127:in `send_login_request'
         9: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/client.rb:411:in `send_shared_login_request'
         8: from /var/lib/gems/2.5.0/gems/fastlane-2.115.0/spaceship/lib/spaceship/client.rb:567:in `load_session_from_file'
         7: from /var/lib/gems/2.5.0/gems/http-cookie-1.0.3/lib/http/cookie_jar.rb:324:in `load'
         6: from /var/lib/gems/2.5.0/gems/http-cookie-1.0.3/lib/http/cookie_jar.rb:324:in `open'
         5: from /var/lib/gems/2.5.0/gems/http-cookie-1.0.3/lib/http/cookie_jar.rb:325:in `block in load'
         4: from /var/lib/gems/2.5.0/gems/http-cookie-1.0.3/lib/http/cookie_jar/yaml_saver.rb:24:in `load'
         3: from /var/lib/gems/2.5.0/gems/psych-3.1.0/lib/psych.rb:277:in `load'
         2: from /var/lib/gems/2.5.0/gems/psych-3.1.0/lib/psych.rb:390:in `parse'
         1: from /var/lib/gems/2.5.0/gems/psych-3.1.0/lib/psych.rb:456:in `parse_stream'
/var/lib/gems/2.5.0/gems/psych-3.1.0/lib/psych.rb:456:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 110 column 1 (Psych::SyntaxError)
ubuntu@tegra-ubuntu:/mnt/HDD/itunes-connect-slack$ ```

CI support contribution

Hi, I'm using this project to get app status updates through our circleCI setup, I changes the polling to just fetch once and have it running every X minutes through CI (circle). I'd like to submit a PR but wanted to know if you'd be open to this change so we can continue using this project instead of duplicating it.

The changes would be:

  • add a new way to execute this so it doesn't poll, just runs once.
  • adds a circle config file with 1 workflow that runs on cron, using circle caching we can achieve database persistence.
  • sets the channel name to a ENV var, so it doesn't have to be committed to the project.

`getVersionInfo': undefined method `edit_version' for nil:NilClass (NoMethodError)

Fetching latest app status...
There was a problem fetching the status of the app!
get-app-status.rb:6:in getVersionInfo': undefined method edit_version' for nil:NilClass (NoMethodError)
from get-app-status.rb:48:in block in getAppVersionFrom' from get-app-status.rb:47:in each'
from get-app-status.rb:47:in getAppVersionFrom' from get-app-status.rb:82:in block in

'
from get-app-status.rb:78:in each' from get-app-status.rb:78:in '

Get this error after running the node poll-itc.js. I'm not a ruby expert but it looks like whatever this block is supposed to be doing in get-app-status.rb is not doing it.

def getVersionInfo(app)
  
editVersionInfo = app.edit_version
liveVersionInfo = app.live_version

get-app-status fails with require error

node poll-itc.js
Fetching latest app status...
There was a problem fetching the status of the app!
/Library/Ruby/Site/2.3.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- spaceship (LoadError) from /Library/Ruby/Site/2.3.0/rubygems/core_ext/kernel_require.rb:54:in require'
from get-app-status.rb:1:in `

'

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.