This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| require 'json' | |
| Encoding.default_external = 'UTF-8' | |
| query = params['query'] || 'banana' | |
| page = (params['page'] || 0).to_i | |
| from = page * 100 | |
| uri = URI('https://mercadao.pt/api/catalogues/6107d28d72939a003ff6bf51/products/search') | |
| uri.query = URI.encode_www_form({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| Encoding.default_external = 'UTF-8' | |
| query = params['query'] || 'banana' | |
| page = (params['page'] || 0).to_i | |
| url = "https://www.auchan.pt/pt/pesquisa?q=#{query}&search-button=&lang=pt_PT&start=#{page * 24}&sz=24" | |
| document = Nokogiri::HTML(open(url)) | |
| search_items = document.css('div.auc-product').map do |tile| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| Encoding.default_external = 'UTF-8' | |
| query = params['query'] || 'banana' | |
| page = (params['page'] || 0).to_i | |
| url = "https://lojaonline.intermarche.pt/26-famoes/produit/recherche?mot=#{query}" | |
| document = Nokogiri::HTML(open(url)) | |
| search_items = document.css('ul.vignettes_produit > li.vignette_produit_info').map do |tile| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| Encoding.default_external = 'UTF-8' | |
| query = params['query'] || 'banana' | |
| page = params['page'].to_i || 0 | |
| url = "https://www.continente.pt/pesquisa/?q=#{query}&start=#{page * 36}&srule=Continente%2003&pmin=0.01" | |
| document = Nokogiri::HTML(open(url)) | |
| search_items = document.css('div.productTile').map do |tile| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| Encoding.default_external = 'UTF-8' | |
| query = params['query'] || 'banana' | |
| page = params['page'].to_i || 0 | |
| url = "https://www.celeiro.pt/catalogsearch/result/?q=#{query}" | |
| document = Nokogiri::HTML(open(url)) | |
| search_items = document.css('ol.product-items > li.item').map do |tile| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GET /admin-ajax.php?action=carris_get_line_alerts&line_id=1604 HTTP/1.1 | |
| Host: cache.geobus.pt | |
| Connection: keep-alive | |
| sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108" | |
| Accept: application/json, text/javascript, */*; q=0.01 | |
| sec-ch-ua-mobile: ?0 | |
| User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 | |
| sec-ch-ua-platform: "macOS" | |
| Origin: https://www.carrismetropolitana.pt | |
| Sec-Fetch-Site: cross-site |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "nokogiri" | |
| require "open-uri" | |
| url = "https://pt.teamlyzer.com/companies/jobs?page=#{params['page']}" | |
| document = Nokogiri::HTML(open(url)) | |
| page = params['page'].nil? ? "1" : params['page'] | |
| rows = document.xpath('//div[@class="row jobboard-ad"]') | |
| titles = rows.xpath('//h4[@class="small-title pull-left"]').map { |position| position.text.strip } | |
| positions = rows.xpath('//small[@class="job-tag-template job-work-profession"]') .map { |position| position.text.strip } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "nokogiri" | |
| require "open-uri" | |
| url = "https://pt.teamlyzer.com/companies/jobs?page=#{params['page']}" | |
| document = Nokogiri::HTML(open(url)) | |
| page = params['page'].nil? ? "1" : params['page'] | |
| rows = document.xpath('//div[@class="row jobboard-ad"]') | |
| titles = rows.xpath('//h4[@class="small-title pull-left"]').map { |position| position.text.strip } | |
| positions = rows.xpath('//small[@class="job-tag-template job-work-profession"]') .map { |position| position.text.strip } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| # Get a Nokogiri::HTML:Document for the page we're interested in... | |
| doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')) | |
| # Do funky things with it using Nokogiri::XML::Node methods... | |
| #### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "nokogiri" | |
| require "open-uri" | |
| require 'json' | |
| url = "https://speakerdeck.com/#{params['username']}?page=#{params['page']}" | |
| document = Nokogiri::HTML(open(url)) | |
| page = params['page'].nil? ? "1" : params['page'] | |
| images = document.xpath('//div[@class="deck-preview-slide"]').xpath('//@style').map { |img| img.text.split(';')[0] }.map { |img2| img2.split(':')[2] }.compact { |img3| img3 }.map { |img4| 'https:' + img4.split('\'')[0] }.uniq |