GithubHelp home page GithubHelp logo

alexflipnote / ukraine_discord Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 6.0 45 KB

A script that gets the news from liveuamap.com to post is on Discord as a webhook

Home Page: https://discord.gg/AlexFlipnote

License: MIT License

Python 100.00%
ukraine discord webhook news updates russia invasion python ukraine-invasion

ukraine_discord's Introduction

ukraine_discord

A script that gets the news from liveuamap.com to post is on Discord as a webhook

Live view

The bot is currently running and posting news right now as an example inside my personal Discord server, inside the channel #general_whatever within the thread called Ukraine Vs Russia - Discussion and News.

Requirements

  • Python 3.6 or higher
  • Discord webhook URL

Credits

  • Atomikkunn
    • Figuring out how to check what category each posts are

Config file

Variable Description
embed_image Define if images should be shown in embed or not (Bool)
user_agent Make custom User-Agent for requests
webhook_url Discord webhook URL from your Discord
article_fetch_limit How many articles it will go through to see if anything's new
debug Debug mode, true/false

Example outputs

ukraine_discord's People

Contributors

alexflipnote avatar neppkun 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

Watchers

 avatar  avatar  avatar

ukraine_discord's Issues

AttributeError when fetching articles

When running the program the output is this.

�[36m[?]�[0m 2022-03-07 09:20:03.207320 - Checking for new articles
�[32m[+]�[0m Fetching all articles and parsing HTML...
�[33m[!]�[0m File "C:\Users\A##-pc\Desktop\ukraine_discord-master\index.py", line 182, in main
r = fetch("https://liveuamap.com/")
File "C:\Users\Alex-pc\Desktop\ukraine_discord-master\index.py", line 164, in fetch
"User-Agent": read_json("user_agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)")
File "C:\Users\Alex-pc\Desktop\ukraine_discord-master\index.py", line 81, in read_json
return data.get(key, default)
AttributeError: 'list' object has no attribute 'get'

This repeats as it tries to get new articles.

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.