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
/* | |
Colors: | |
rgba(255,255,245, 1) | |
rgba(209,219,189, 1) | |
rgba(145,170,157, 1) | |
rgba(62,96,111, 1) | |
rgba(25,52,65, 1) | |
*/ |
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
def greeting | |
puts "Please Enter Your Name:" #comment syntax is less fun than others. | |
name = gets.chomp | |
puts "Hello" + " " + name | |
end | |
greeting |
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
def fav_foods | |
food_arr = [] | |
3.times do | |
puts "Name a favorite food." | |
food_arr << gets.chomp | |
end | |
$i=0 | |
print "your favorite foods are " | |
food_arr.each do |food| | |
$i+=1 |
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
class Cat | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed, name) | |
@color = color | |
@breed = breed | |
@name = name | |
@hungry = true | |
end | |
def feed(food) |
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
class Pet | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end |
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
mkdir mondo-price && cd mondo-price |
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
const rpn = require('request-promise-native') | |
rpn('https://mondotees.com/collections/archive/Posters?page=1', options) | |
.then(function (response) { | |
console.log('body:', body); | |
}).catch(function (error) { | |
// define a promise catch in case it failed along the way | |
console.log('Promise Error:', error) | |
}) |
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
const rpn = require('request-promise-native') | |
const cheerio = require('cheerio') | |
// define our headers | |
const options = { | |
headers: {'user-agent': 'node.js'} | |
} | |
rpn('https://mondotees.com/collections/archive/Posters?page=1', options) | |
.then(function (response) { |
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
const cheerio = require('cheerio') | |
const jsonfile = require('jsonfile') | |
const rpn = require('request-promise-native') | |
/******************************** | |
* Include some extra params we'll need. | |
* 'headers' is particularly important to define because the | |
* server will reject the request without it. | |
*********************************/ | |
const url = 'https://mondotees.com' |
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
const cheerio = require('cheerio') | |
const jsonfile = require('jsonfile') | |
const rpn = require('request-promise-native') | |
// define our input and output files | |
const readFile = './poster_urls.json' | |
const detailsFile = './poster_details.json' | |
const errFile = './detail_scrape_errors.json' | |
/******************************** |