This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getShopeeOrderData = () => [...document.querySelectorAll('.order-card__container')].map(node => ({ | |
name: node.querySelector('.order-content__item__name').innerText, | |
price: parseInt(node.querySelector('.purchase-card-buttons__total-price').innerText.slice(1).replaceAll(',', '')), | |
orderURL: node.querySelector('.order-content__item-wrapper').href | |
})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, go to https://shopee.co.th/user/purchase, and open DevTools. | |
// Step 1 - Run this code to scroll all the way to the bottom. | |
const timer = setInterval(() => scrollTo(0, 10000000), 800) | |
setTimeout(() => { | |
// Step 2 - Stop scrolling after 1 minute. | |
clearInterval(timer) | |
// Step 3 - Sum the total purchase price! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function run() { | |
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
const selector = 'div[aria-label="Toggle to follow"] div' | |
const nodes = [...document.querySelectorAll(selector)] | |
for (let node of nodes) { | |
const text = node.parentElement.parentElement.parentElement.innerText | |
console.log(text) |
I hereby claim:
- I am heypoom on github.
- I am phoomparin (https://keybase.io/phoomparin) on keybase.
- I have a public key whose fingerprint is CEF4 D7CC 960A BC86 CF21 7924 C131 6F6C E737 E008
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require("readline") | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}) | |
const read = (query) => new Promise((r) => rl.question(query, r)) | |
const print = console.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@babel/runtime | |
@emotion/cache | |
@emotion/core | |
@emotion/css | |
@emotion/hash | |
@emotion/is-prop-valid | |
@emotion/memoize | |
@emotion/serialize | |
@emotion/sheet | |
@emotion/styled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import json | |
import requests | |
from multiprocessing.pool import ThreadPool | |
def build_index(): | |
page = 1 | |
urls = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
# Randomize an integer between 0 to n. | |
def randomize(maximum): | |
return randint(0, maximum) | |
class OpenClosedGame: | |
is_playing = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import {useState} from 'react' | |
import ReactDOM from 'react-dom' | |
function FileReader() { | |
const [text, setText] = useState('') | |
function onChange(e: React.ChangeEvent<HTMLInputElement>) { | |
const {files} = e.target | |
const [file] = files |
NewerOlder