This file contains 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
item_links = response.css('.large > .detailsLink::attr(href)').extract() | |
for a in item_links: | |
yield scrapy.Request(a, callback=self.parse_detail_page) |
This file contains 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
import scrapy | |
class OlxItem(scrapy.Item): | |
# define the fields for your item here like: | |
# name = scrapy.Field() | |
pass |
This file contains 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 OlxItem(scrapy.Item): | |
# define the fields for your item here like: | |
title = scrapy.Field() | |
price = scrapy.Field() | |
url = scrapy.Field() |
This file contains 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
import ReactMapboxGl, { Layer, Feature } from "react-mapbox-gl"; | |
const Map = ReactMapboxGl({ | |
accessToken: "pk.eyJ1IjoiZmFicmljOCIsImEiOiJjaWc5aTV1ZzUwMDJwdzJrb2w0dXRmc2d0In0.p6GGlfyV-WksaDV_KdN27A" | |
}); | |
// in render() | |
<Map | |
style="mapbox://styles/mapbox/streets-v9" |
This file contains 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
import { lineString, along, lineDistance } from '@turf/turf'; | |
const OPTIONS = { units: 'feet' }; | |
// 30.1 seconds, the .1 is to allow a buffer for the next set of cords to load | |
// I know it's not exact, but it's close :) | |
const STEPS = 30100; | |
//inside component function | |
useEffect(() => { | |
let arc = []; |
This file contains 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
return ( | |
<Marker coordinates={currentLocation} anchor="center"> | |
<div className="pulsating-circle" />; | |
</Marker> | |
); |
This file contains 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
export function chunk(arr, size) { | |
const R = []; | |
for (var i = 0, len = arr.length; i < len; i += size) | |
R.push(arr.slice(i, i + size)); | |
return R; | |
} |
This file contains 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
export class ArrayUtils { | |
static chunk<T>(array: T[], chunkSize: number): T[][] { | |
const chunks: T[] = []; | |
let index = 0; | |
while(index < array.length){ | |
chunks.push(array.slice(index, index + chunkSize); | |
index += chunkSize | |
} | |
return chunks; |
This file contains 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
pip install beautifulsoup | |
pip install apscheduler |
This file contains 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
# scrape.py | |
import os | |
import requests | |
from BeautifulSoup import BeautifulSoup | |
from apscheduler.schedulers.blocking import BlockingScheduler | |
from datetime import datetime | |
sch = BlockingScheduler() | |
def main(): | |
url = 'https://www.indeed.com/jobs?q=web%20developer&l=Denver%2C%20CO&vjk=0c0f7c56b3d79b4c' | |
response = requests.get(url) |