I hereby claim:
- I am jaboutboul on github.
- I am jaboutboul (https://keybase.io/jaboutboul) on keybase.
- I have a public key ASAb-fWVutbl6mJOltdHMVQIVIUZPSmM6ChC7tQxaNhE8Ao
To claim this, I am signing this object:
#version=Alma9 | |
# Use graphical or text install | |
# graphical | |
text | |
repo --name="AppStream" --baseurl=http://repo.almalinux.org/almalinux/9.0/AppStream/ | |
%packages | |
@^minimal-environment | |
#@^virtualization-host-environment |
docker run -d -p 3322:3322 -it --rm --name immudb codenotary/immudb:latest |
Verifying my Blockstack ID is secured with the address 1NmKpvvMPwf8GnvggFkqbn2TRKHF7KyxWo https://explorer.blockstack.org/address/1NmKpvvMPwf8GnvggFkqbn2TRKHF7KyxWo |
I hereby claim:
To claim this, I am signing this object:
import psycopg2 | |
from sqlalchemy import * | |
import ikea2 | |
from twilio.rest import TwilioRestClient | |
import sys | |
import local_settings | |
#connect to database | |
db = create_engine(local_settings.DB_INFO) | |
metadata=MetaData(db) |
#create Bitly Url | |
def makeBit(url): | |
b = bitlyapi.BitLy("mauerbac", local_settings.BITLY_API_KEY) #Add bitly API key | |
res = b.shorten(longUrl=url) | |
return res['url'] |
#after problem is detected, find the problem | |
def findproblems(html,soup,br,user_id,number): | |
soup=BeautifulSoup(html, "lxml") | |
#searches for No location text | |
noavailable=soup.findAll("div", {"class": "sc_com_noLocationText sc_find_it_location_text"}) | |
noavailablesize=len(noavailable) | |
noresults=soup.findAll("h2", {"class": "headerLeftNavi"}) #searches for "search results" -meaning invaild entry | |
nosize=len(noresults) | |
outofstock=soup.findAll("div", {"class": "sc_com_stockInfo sc_graph_stockInfo_container"}) #searches for out of stock text | |
outofstocksize=len(outofstock) |
def pullInfo(html,br,user_id,number): | |
soup=BeautifulSoup(html) | |
loc=soup.findAll("div", {"class": "sc_com_locationNo sc_find_it_location_number"}) #find location | |
locsize=len(loc) | |
if(locsize==0): #check for problems | |
findproblems(html,soup,br,user_id,number) | |
if(locsize>2): #check for multiple locations | |
response=doubleloc(user_id,locsize,loc,soup) | |
return sendOut(response,number) | |
aisle=loc[0].text #pull aisle number |
soup=BeautifulSoup(html, "lxml") #create soup object from page response | |
loc=soup.findAll("div", {"class": "sc_com_locationNo sc_find_it_location_number"}) #try to find loc & bin | |
locsize=len(loc) | |
#is location available | |
if(locsize==0): | |
return findproblems(html,soup,br,userid,number) | |
response= pullInfo(html,br,userid,number) | |
return sendOut(response,number) |
itemnum=message | |
br=mechanize.Browser() | |
br.open("http://www.ikea.com/us/en/catalog/stockcheck/") #open catalog | |
br.select_form(name="stocksearch") #select form | |
br.form['query']= itemnum #pass item number | |
br.form['ikeaStoreNumber1']= [local_settings.STORE_NUMBER] | |
br.submit() #submit form | |
html=br.response().read() |