Question

Specifications You will need to understand the requests, cheerio, and nodemailer modules to parse...

Specifications

You will need to understand the requests, cheerio, and nodemailer modules to parse an HTML webpage and email specific parts to an end-user.

Artist Email-Scraper

Create a file called artists.js that will scrape the provided url: https://www.billboard.com/charts/rap-song and send an email of all artists & songs that are sung by the specified artists given via the command line.

Requirements:

• The specified artists must be read in via the command line

• If no artist(s) are specified do not send an email

• If the specified artist(s) are not found on the website, do not send an email

• If the specified artist(s) are found on the website:

– Send an email from an email account of your choice, to an email account of your choice (when I am testing this, I will input my own accounts for this portion)

– The subject will be: “Your artist(s) are: ” followed by a list of the artist(s). Be sure to format this portion correctly i.e. if the user specifies node artists Drake Migos xxxtentacion your subject should be: Your artists are: Migos, Drake, and xxxtentacion

– The email format should be the artist in bold and the song name in italics, see below

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Requirement: As per the problem, we need to Create a file called artists.js that will scrape the provided url: https://www.billboard.com/charts/rap-song and send an email of all artists & songs that are sung by the specified artists given via the command line.

Solution: Below is the implementation of above problem in Javascript

const reqp = require('request-promise');

const cheerio = require('cheerio');

const options = {

uri: 'https://www.billboard.com/charts/rap-song',

transform: function (error, response, html) {

return cheerio.load(html);

}

reqp(options)

.then(($) => {

scrap_data = $('a.chart-row__artist').each(function())

If($((this).text().trim() == artist)

{

console.log(artist + “ “ + $(this).text() + song + “ “ +$(this).siblings('.chart-row__song').text());

})

.catch((err) => {

console.log(err);

});

Add a comment
Know the answer?
Add Answer to:
Specifications You will need to understand the requests, cheerio, and nodemailer modules to parse...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please use C programming to write the code to solve the following problem. Also, please use the i...

    Please use C programming to write the code to solve the following problem. Also, please use the instructions, functions, syntax and any other required part of the problem. Thanks in advance. Use these functions below especially: void inputStringFromUser(char *prompt, char *s, int arraySize); void songNameDuplicate(char *songName); void songNameFound(char *songName); void songNameNotFound(char *songName); void songNameDeleted(char *songName); void artistFound(char *artist); void artistNotFound(char *artist); void printMusicLibraryEmpty(void); void printMusicLibraryTitle(void); const int MAX_LENGTH = 1024; You will write a program that maintains information about your...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Project Description In this project, you will design and implement a database for keeping track of...

    Project Description In this project, you will design and implement a database for keeping track of information for an online “SOCIAL NETWORK” system (e.g. a simplified version of Facebook!). You will first design an EER schema diagram for this database application. Then, you will map the EER schema into a relational database schema and implement it on ORACLE or MySQL or some other relational DBMS. Finally, you will load some data into your database (via user Interface) and create some...

  • Don't attempt if you can't attempt fully, i will dislike a nd negative comments would be...

    Don't attempt if you can't attempt fully, i will dislike a nd negative comments would be given Please it's a request. c++ We will read a CSV files of a data dump from the GoodReads 2 web site that contains information about user-rated books (e.g., book tit le, publication year, ISBN number, average reader rating, and cover image URL). The information will be stored and some simple statistics will be calculated. Additionally, for extra credit, the program will create an...

  • Don't attempt if you can't attempt fully, i will dislike and negative comments would be given...

    Don't attempt if you can't attempt fully, i will dislike and negative comments would be given Please it's a request. c++ We will read a CSV files of a data dump from the GoodReads 2 web site that contains information about user-rated books (e.g., book titnle, publication year, ISBN number, average reader rating, and cover image URL). The information will be stored and some simple statistics will be calculated. Additionally, for extra credit, the program will create an HTML web...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT