mohamedyasser97 / lyricurator Goto Github PK
View Code? Open in Web Editor NEWA bot that scrapes azlyrics.com for lyrics and other data with additional tweeting functionality
Home Page: https://twitter.com/lyricurator
License: The Unlicense
A bot that scrapes azlyrics.com for lyrics and other data with additional tweeting functionality
Home Page: https://twitter.com/lyricurator
License: The Unlicense
It should work like this python lyricurator.py --interval 10
. This should print/tweet lyrics every 10 minutes.
Adding the CLI argument -ls
or --listsongs
should print all song names for the randomly selected artist instead of printing/tweeting lyrics.
If the user sets a predefined artist with -a/--artist
then print all song names for that specific artist
The file lyricurator.py
calls different functions based on the user's choice of CLI arguments. However, running the bot with just -hs
or -hal
for example won't work as in the code it requires notwitter
to be set to true while it should work alone just fine
The current implementation of -la/--listartists
uses the function get_artist_names
which uses get_artists_links
inside of it.
The problem is that get_artists_links
selects a random first character of an artist's name and fetches this page for example https://www.azlyrics.com/m.html
. This means that it only gets artists with names starting with m
which is not "all" artists.
One solution is just loop for all letters but this is time consuming and will risk an IP ban from azlyrics.
So the required solution is to edit the argument -la/--listartists
and make it accept a letter as an input and then only get artist names that start with that input character.
Note: get_artists_links
is used by other functions too so be careful what you change.
Create the CLI argument -hs/--hotsongs
that gets the list of hot songs on the homepage of azlyrics.com and then exits the program.
On running python lyricurator.py
without any CLI arguments, it sends a tweet by default.
Instead of this behavior, it is required to force users to at least add -nt/--notwitter
or the new CLI argument you would create -t/--twitter
that sends the lyrics in a tweet.
If a user executes lyricurator without any arguments, print out argparse
's help screen and exit the program.
Currently, it's mandatory to use either one of -nt
or -t
. It makes no sense to use one of those when we only want to print something in the terminal and exit like -la
, -ls
or the upcoming -hal
and -hs
.
It's required to make -nt
or -t
only mandatory when used with any arguments except the ones mentioned above.
Make a cli arg to get all currently available artist names.
Create the CLI argument -hal/--hotalbums
that gets the list of hot albums on the homepage of azlyrics.com and then exits the program.
It would be nice if someone could refactor this project into modules so it can just act as a CLI lyrics tool with the Twitter feature just as an added feature
Posting to twitter should be optional via a cli argument
Instead of scraping 2 or 3 lines of lyrics, the CLI argument -fs
or --fullsong
should get the whole song lyrics.
Notes:
-nt/--notwitter
to true
.-nt
with -fs
, then execute -fs
and print this below/above the lyrics: 'Full song lyrics can't be tweeted'
.-nt
and -fs
, then just print the full song lyrics.Current visible auth credentials are already revoked.
Auth credentials should be in a separate file that is added to .gitignore
Add a cli argument that makes the bot only fetch lyrics from the given artist
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.