Skip to content

Instantly share code, notes, and snippets.

@xbns
xbns / download-pdfs.py
Last active June 6, 2019 09:49
#parallel #scraping pdfs
from bs4 import BeautifulSoup
import requests
r = requests.get("https://aws.amazon.com/whitepapers/")
data = r.text
soup = BeautifulSoup(data,"lxml")
for link in soup.findAll('a',href=True):
#skip all other liks except pdf ones
if not link['href'].endswith('pdf'):
@xbns
xbns / create-user-order.py
Last active November 18, 2020 15:04
create random user and order via API
import requests
import names
import random
import json
token = ''
#program_id = ''
program_id = '2ba0d47c-dea6-11e8-b2b3-06f77de3a7f0' # Test Program
location_id = '09942cd5-f100-42c3-a175-cd620cd3bc7c' # Kilimani
@xbns
xbns / search-user-api.py
Last active January 7, 2019 08:01
search user given api endpoint
import requests
import json
import csv
token = ''
program_id = ''
def get_auth_token(token,program_id):
endpoint = 'https://xxx.mycompany.yy/auth/login'
payload = {