GithubHelp home page GithubHelp logo

alchemydc / destiny2-xur-discord Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 2.0 23 KB

Destiny is a looter shooter FPS/MMO from Bungie, the creators of Halo. This repo will post Xur's location and inventory of exotic loot to a Discord webhook, designed to be run from cron or as a cloud function

Home Page: https://www.bungie.net/7/en/Destiny/NewLight

License: MIT License

Python 98.16% Shell 1.84%
destiny2 destiny2api discord-webhook xur

destiny2-xur-discord's Introduction

destiny2-xur-discord

Overview

Xur is an NPC in Bungie's MMO shooter Destiny2 which is a space magic infused descendant of Halo.
Xur visits only for a few days a week, landing on Fridays and selling different exotic weapons and armor from a random location.

This script Post Xur's location and inventory to a Discord webhook, and is designed to be run from cron or as a cloud function.

alt text

Gratitude

  • Thanks to @nev for exposing the magical API that shares Xur's location as JSON.
  • Thanks to the kind folks on the Destiny API Discussion Discord for helping me wrap my head around the new D2 API.

Requirements

Installation (Linux or OSX)

  1. Create a separate user named 'xur'
sudo adduser xur
  1. Change to the 'xur' user
sudo su - xur
  1. Clone the repo
git clone https://github.com/alchemydc/destiny2-xur-discord.git
  1. Create and activate a python virtual environment (recommended to keep deps separate from system python)
python3 -m virtualenv . && source bin/activate
  1. Install python dependencies (requests for making the https API calls, python-dotenv for keeping secrets out of the source)
python -m pip install -r requirements.txt

Configuration

  1. Copy the environment template
cp .env-template .env
  1. Populate the .env file with your Bungie API key and Discord webhook URL

Test run

python3 xur.py

Schedule it to run automatically

Xur comes on Fridays after the daily reset, so it's convenient to have this script run right after that. If Xur has something you don't, then go see him!

  1. Make xur wrapper bash script and python script executable
chmod u+x xur.sh xur.py
  1. Install crontab to run script automatically
/usr/bin/crontab xur.crontab

Troubleshooting

If things aren't working as expected, ensure that your Bungie API key and Discord webhook are set correctly.

If the script works when run directly, but fails when run by cron, check to ensure your home directory is correct in xur.sh, and that env vars are being properly imported by python-dotenv.

destiny2-xur-discord's People

Contributors

alchemydc avatar

Watchers

 avatar  avatar  avatar

Forkers

jdevl1 jfkadept

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.