Skip to content

Instantly share code, notes, and snippets.

View neilmenon's full-sized avatar

Neil Menon neilmenon

View GitHub Profile
import requests
import datetime
def print_log(message: str):
print("[{}] ".format(str(datetime.datetime.now())) + message)
on_url = "https://oldnavy.gap.com/browse/product.do?pid=473484012&cid=72305&pcid=72305&vid=1&cpos=20&cexp=2223&kcid=CategoryIDs%3D72305&cvar=16849&ctype=Listing&cpid=res2212252059442943921053#pdp-page-content"
html = requests.get(on_url).text
@neilmenon
neilmenon / spotify_auth.php
Created December 30, 2022 21:20
Spotify Token Authorization in PHP
<?php
$client_id = "your client id";
$client_secret = "your client secret";
$redirect_uri = "redirect URI, should be the URL to this PHP file after placed on a web server (e.g. http://localhost:9000/spotify_auth.php)";
if(isset($_GET["code"])) { // return the auth details
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://accounts.spotify.com/api/token");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);