Skip to content

Instantly share code, notes, and snippets.

View BetterProgramming's full-sized avatar

BetterProgramming

View GitHub Profile
import scrapy
class OlxItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
class OlxItem(scrapy.Item):
# define the fields for your item here like:
title = scrapy.Field()
price = scrapy.Field()
url = scrapy.Field()
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"
return (
<Marker coordinates={currentLocation} anchor="center">
<div className="pulsating-circle" />;
</Marker>
);
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;
}
pip install beautifulsoup
pip install apscheduler
# 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)
# sendMessage.scpt
on run {targetPhoneNumber, targetMessageToSend}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetPhoneNumber of targetService
set targetMessage to targetMessageToSend
send targetMessage to targetBuddy
end tell
end run
# scraper.py
for jobTitle in matches:
if "Junior" in jobTitle.text:
os.system("osascript sendMessage.scpt YOUR_NUMBER_HERE 'YOUR_MESSAGE_HERE' ")
break
elif "Jr" in jobTitle.text:
os.system("osascript sendMessage.scpt YOUR_NUMBER_HERE 'YOUR_MESSAGE_HERE' ")
break
# scraper.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)