Skip to content

Instantly share code, notes, and snippets.

#%%
import scraperwiki
import re
import requests
import json
import pandas as pd
import time
#%%
@nickjevershed
nickjevershed / hashtag.py
Created January 10, 2024 23:55
Demonstration of a script to get TikTok video stats from a hashtag
from TikTokApi import TikTokApi
import asyncio
import os
import json
import scraperwiki
import asyncstdlib as a
ms_token = ['YOUR TOKEN HERE']
async def get_hashtag(hashtag):
import pandas as pd
filenames = ['observatory-hill','parramatta','wollongong']
# filenames = ['observatory-hill']
# filename = 'lismore'
for filename in filenames:
df = pd.read_csv(f'{filename}.csv')
import requests
from zipfile import ZipFile
from io import BytesIO
import os
import time
from datetime import datetime
import schedule
url = "https://resultsxml.elections.qld.gov.au/Upload/publicResults.zip"
import requests
from zipfile import ZipFile
from io import BytesIO
import os
import time
from datetime import datetime
import schedule
timestamp = datetime.strftime(datetime.now(), '%Y%m%d%H%M%S')
url = "https://resultsxml.elections.qld.gov.au/Upload/publicResults.zip"
import requests
import json
import scraperwiki
from datetime import datetime
url = 'https://wabi-australia-southeast-api.analysis.windows.net/public/reports/querydata?synchronous=true'
headers = {
"Accept": "application/json, text/plain, */*",
"ActivityId": "a1955107-c5d9-12b5-87a4-561001265ed6",
@nickjevershed
nickjevershed / corona.py
Created March 12, 2020 04:57
Gets the latest data from the Johns Hopkins COVID-19 tracker, via GitHub
# This script will get the latest data from the Jons Hopkins GitHub repo https://github.com/CSSEGISandData
def getData():
import requests
files = [
"time_series_19-covid-Confirmed.csv",
"time_series_19-covid-Deaths.csv",
"time_series_19-covid-Recovered.csv"
@nickjevershed
nickjevershed / demo.py
Created February 26, 2020 02:35
Demo of API paging
import requests
import scraperwiki
import math
# Function to save data into a SQLite database
def saveData(records):
scraperwiki.sqlite.save(unique_keys=["_id"], data=records)
# Get initial page of API results and create a json object
#%%
import pandas as pd
import simplejson as json
from datetime import datetime
#%%
with open('1R3zG-DJRqN7MFLGqjhZs26D1SJcKI7pkd1j1XDwAiIM.json') as birdJson:
birdsInfo = json.load(birdJson)['sheets']['Sheet1']
================================================================
New ad from Liberal Party of Australia
Bill Shorten can't accurately answer simple questions about his new electric car policy. Yet he's pushing a plan that would drive up the cost of some cars by thousands of dollars.
https://www.facebook.com/LiberalPartyAustralia/
================================================================
New ad from ABC Friends
HOW WILL IT ALL END? Cartoon offering and a question from a great supporter of the ABC - Joan Rosser. PLEASE DONATE TO OUR ELECTION FUND SO WE CAN MAKE THE ABC CENTRAL TO THE ELECTION CAMPAIGN: https://www.mycause.com.au/page/198208/donate-to-make-the-abc-central-to-the-election
https://www.facebook.com/FriendsOfTheAbc/
================================================================
New ad from Australian Family Coalition