Git Product home page Git Product logo

shift-code's Introduction

Gearbox Shift Code Repo

Monorepo for Gearbox Shift code automatic redemption

Usage

You're probably looking for the command line tool, which will automatically redeem shift codes for you.

If you're a developer, some of the other packages might interest you in creating your own redemption tool.

Packages

Package Description
@shift-code/cli Command-line tool for redeeming codes
@shift-code/api API for interacting with shift website
@shift-code/get Library for retrieving shift codes

Deployment

  • Run yarn run tag <package>
    • eg: yarn run tag cli
  • Enter new version for package
  • Version will be changed and a tag will be created
  • Tag and commit are then pushed
  • Workflow triggers on tag, publishing to NPM and creating a Github release

shift-code's People

Contributors

dependabot[bot] avatar thedanieljlewis avatar trs 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

Watchers

 avatar  avatar  avatar  avatar  avatar

shift-code's Issues

Adding option to the (redeem) command

Hi first thnx for the awesome tool :)
I was thinking if you consider adding option to specify which platform & Game version will be redeemed, it will make the process faster and also will not trigger "you need to lunch the game " as fast.
So it will be something like this
Shift-code redeem --P (platform) --V (version)
Thanx in advance the tool is awesome as is

Suggestion: login switches or file

It'd be great if this could didn't require re-entering login info every time. This could be done with -e/--email and -p/--password, read from a file, or from an environment variable.

Broken?

I think this is broken. After cloning and running npm i, I tried both ways of running the script (npm run redeem in the GIF, and npx shift-code-redeemer in the written instructions). The latter returns the error:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/shift-code-redeemer - Not found
npm ERR! 404
npm ERR! 404  'shift-code-redeemer@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-19T02_01_13_529Z-debug.log
Install for shift-code-redeemer@latest failed with code 1

It looks like the script is no longer on npmjs.

Allow pasting of email/password

Perhaps this is a limitation of running inside the terminal, but normally text can be pasted into a terminal, so it seems it should be able to be done here as well. I use a password manager with long, complex passwords, as should everyone, and whenever something restricts pasting or autofill, whether it's a website or program, it essentially punishes and discourages the use of a password manager, which is definitely not what should be done. I'm not sure how long a session will be maintained, but I'm thinking this is something that could be run every month or two, and having to manually type my long password in each time would be annoying.

Use manually created code file

This is a great utility, but it's severely limited due to only using codes from a particular source. After running it, I manually added several codes I found elsewhere and none of them had been used yet. If I could just copy the whole block of codes from the site and paste them into a file then point shift-code to that file, it would allow the process to be semi-automated and to go much faster.

Associate cache to account that redeemed the code

In v1.0, shift codes are cached all together instead of with the account that redeemed them. This is a regression from v0.0.

When loading the code cache during redeem use the session account ID as a key when adding a cached code.

Something along these lines should do it:

const cache = await loadContents<CacheStore>(CACHE_FILE, {});
if (!cache[acc.id]) {
  cache[acc.id] = [];
}

...

cache[acc.id].push(code);
await storeContents(CACHE_FILE, cache);

Should we store cached codes in a different file instead of in the same?

Automated deployment

With the monorepo, automated deployments are now more difficult.
Ideally this would look like this:

Any changes to api or source would cause their respective package's version to increment based on semver commits.
Any changes to cli would also increment it's version but would also pkg the binaries and tag a Github release, with said binaries as assets.

Use .\@shift-code\cli\Data instead of %localappdata%\...

For all intents and purposes, this is essentially a "portable" app, even if it doesn't claim to be. There's no installation and it's a very basic command-line program, so the typical user, I would think, would expect that it would be more-or-less self-contained, which is why I was surprised to see it had created a series of folders and files in %localappdata%. I didn't even realize at first that it created any files, but when I saw that it did, I expected them to be in the same directory as the exe, and had to do a search to find them. There are two reasons the executable directory is better: it keeps it truly portable, preventing the placement of potentially undesired data (especially considering it holds the account session data) on a computer that the user may not have intended or wanted to do, and may not realize it did, and it makes it easier to find said data. At the very least, it should ask, on first run, where to store this data or, if you prefer to not use a menu prompting for user input, require a parameter to store it anywhere other than the exe directory.

Cache codes from API, only fetch new ones after a certain amount of time

To help with server load from the API provided by shift.orcicorn.com, we should cache the available codes and only request new ones if the cache is old.

This occurs at 00:02, 06:02, 12:02 and 18:02 server-time ( New York, USA )


On redeem, we want to store the result. Time should probably be based on the meta.generated field. On the next redeem request, check if the current time in New York, USA is > 1 hour from the meta.generated. If it is, send the request. If not, use the cached codes.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot 📦🚀

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.