diff --git a/.github/workflows/continousintegration.yaml b/.github/workflows/continousintegration.yaml new file mode 100644 index 0000000..39d9f8a --- /dev/null +++ b/.github/workflows/continousintegration.yaml @@ -0,0 +1,17 @@ +name: Continuos Integration +on: pull_request + +jobs: + continous-integration: + runs-on: ubuntu-latest + steps: + - uses: action/checkout@v3 + - name: use Node.JS + uses: actions/setup-node@v2 + with: + node-version: 21.x + - name: run, install and test + run: | + npm install + npm run bluid + npm run test diff --git a/src/package.json b/src/package.json index e447dbc..9b49e6f 100644 --- a/src/package.json +++ b/src/package.json @@ -3,7 +3,9 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "start": "nodemon index.js" + "start": "nodemon index.js", + "build": "CI=false && react-scripts build", + "test": "react-scripts test" }, "author": "", "license": "ISC", diff --git a/webscrapper/news.xlsx b/webscrapper/news.xlsx deleted file mode 100644 index b3c0fd2..0000000 Binary files a/webscrapper/news.xlsx and /dev/null differ diff --git a/webscrapper/webScarpperStudy2.py b/webscrapper/webScarpperStudy2.py deleted file mode 100644 index 395815e..0000000 --- a/webscrapper/webScarpperStudy2.py +++ /dev/null @@ -1,32 +0,0 @@ -# Automated web scrapper -# Libraries -# openpyxl -import requests -from bs4 import BeautifulSoup -import pandas as pd - -table = [] # List for the data - -page_to_scrape= requests.get("https://g1.globo.com") # Finding the page to scrape -content = page_to_scrape.content -soup = BeautifulSoup(content, 'html.parser') # Soup object - -# Variable to store the html content of the class of the news -newS = soup.findAll("div", attrs={"class":"feed-post-body"}) - -for news in newS: - title = news.find('a', attrs={'class':'feed-post-link'}) - subtile = news.find('div', attrs={'class':"bstn-related"}) - - # If has subtitle - if(subtile): - table.append([title.text, subtile.text, title['href']]) # Insert data on this setup - # title subtile link to news - else: - table.append([title.text,'', title['href']]) -# Creating Data Frame -dataframe = pd.DataFrame(table, columns=['Title', 'Subtile', 'Link to news']) -dataframe.to_excel('news.xlsx', index=False) # Saving to excel - -# print(table) - diff --git a/webscrapper/webScrapperStudy1.py b/webscrapper/webScrapperStudy1.py deleted file mode 100644 index bb1c376..0000000 --- a/webscrapper/webScrapperStudy1.py +++ /dev/null @@ -1,19 +0,0 @@ -# Libraries -import requests -from bs4 import BeautifulSoup - - -page_to_scrape= requests.get("https://g1.globo.com") # Finding the page to scrape -content = page_to_scrape.content -soup = BeautifulSoup(content, 'html.parser') # Soup object - -# Variable to store the html content of the class of the news -news = soup.find("div", attrs={"class":"feed-post-body"}) - - -title = news.find('a', attrs={'class':'feed-post-link'}) -subtile = news.find('div', attrs={'class':"bstn-related"}) - -print(title.text) # Testing -print(subtile.text) # Subtitle - diff --git a/webscrapper/webscrapper3.py b/webscrapper/webscrapper3.py deleted file mode 100644 index e20cb39..0000000 --- a/webscrapper/webscrapper3.py +++ /dev/null @@ -1,32 +0,0 @@ -# Estudo para extrair dados de produto -# - Obtendo do mercado livre - -# Libraries -import requests -from bs4 import BeautifulSoup - -# base URl -base_url = 'https://lista.mercadolivre.com.br/' - -# Get user input product -product_user = input('Input product to search: ') - -# Web scrapping -reponse = requests.get(base_url + product_user) -site = BeautifulSoup(reponse.text, 'html.parser') -products = site.findAll('div', attrs={'class': 'andes-card ui-search-result ui-search-result--core andes-card--flat andes-card--padding-16'}) - -for product in products: - # We want to find title, href and price of the product - - title = product.find('h2', attrs={'ui-search-item__title'}) - link = product.find('a', attrs={'class':'ui-search-item__group__element ui-search-link__title-card ui-search-link'}) - price_reais = product.find('span', attrs={'class':'andes-money-amount__fraction'}) - price_cents = product.find('span', attrs={'class':'andes-money-amount__cents andes-money-amount__cents--superscript-24'}) - - print('Products title:', title.text) - print('Products link: ', link['href']) - print('Products price:', price_reais.text + ',' + price_cents.text) - print('\n') - - # Could as well find the discount of each product, if exists