Skip to content

Instantly share code, notes, and snippets.

View aoirint's full-sized avatar
🐱

aoirint aoirint

🐱
View GitHub Profile
import pyautogui
mx, my = 300, 100
pyautogui.moveTo(mx, my)
pyautogui.mouseDown(button='right')
pyautogui.mouseUp(button='right')
@aoirint
aoirint / joysound.js
Created February 21, 2020 13:27
Joysound Uta-suki "My History" browser-side backup script for Excel/Spreadsheet
var s = '';
// Run in every page (Browser developer console)
// 演奏日付 曲ID(selSongNo) 曲名 アーティスト名 キー URL
s += $('.usk-block-link').map(function(i,e){var s=$(e).children('span'); var u=$(e).attr('href'); var kid=u.slice(u.lastIndexOf('/')+1, u.lastIndexOf('?')); var a=$(s[0]).text(); var as=a.lastIndexOf('/'); return [ $(s[1]).text().substr(5), kid, a.slice(0,as), a.slice(as+1), $(s[2]).text().substr(3), 'https://www.joysound.com'+u ].join('\t')}).toArray().join('\n') + '\n';
@aoirint
aoirint / dam.js
Created February 21, 2020 13:29
DAM DAM-tomo "Seimitsu Saiten DX-G" browser-side backup script for Excel/Spreadsheet
var s = '';
// Run in every page (Browser developer console)
// 採点日時 曲リクエストID 曲名 アーティスト名 キー 点数 採点ID URL
s += jQuery('#DamHistoryMarkingDxGListResult').find('table').map(function(i,e){var cs=jQuery(e).find('td'); var u=jQuery(cs[1]).find('a').attr('href'); return [ jQuery(cs[0]).text(), u.substr(u.lastIndexOf('=')+1), jQuery(cs[1]).text(), jQuery(cs[2]).text(), jQuery(cs[4]).text(), jQuery(cs[3]).text().slice(0,-1), jQuery(cs[5]).find('a').attr('href'), 'https://www.clubdam.com'+u ].join('\t')}).toArray().join('\n') + '\n';
@aoirint
aoirint / narou.js
Created February 21, 2020 13:40
Narou Bookmark space-delimited URL list browser-side script
$('a.title').map(function(i,e){ return e.href; }).toArray().join(' ');
@aoirint
aoirint / teams.js
Created February 21, 2020 13:53
Microsoft Teams get aadObjectId (use for outgoing webhook service) browser-side script
$('#personDropdown .status-icon').attr('data-tid').substr(17);
@aoirint
aoirint / install_python_opencv_pi4.md
Last active February 21, 2020 16:06
Raspberry Pi 4 (Raspbian Buster) OpenCV Python Install
@aoirint
aoirint / docker-compose.yml
Created February 23, 2020 13:10
App + strapi + selenium + mariadb
version: '3'
services:
app:
build: ./app
restart: always
tty: true
volumes:
- ./app:/code
depends_on:
- selenium
@aoirint
aoirint / selenium-docker.py
Last active March 1, 2020 22:07
Initialize selenium Remote WebDriver
import os
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
REMOTE_DRIVER = os.environ['REMOTE_DRIVER']
driver = webdriver.Remote(
command_executor=REMOTE_DRIVER,
desired_capabilities=DesiredCapabilities.CHROME,
@aoirint
aoirint / twurl.py
Created March 1, 2020 23:52
split Twitter URL regex (no slash escape)
import re
from urllib.parse import urlparse
s = 'https://twitter.com/nanashiwan/status/1234137030084349952'
# s = 'https://twitter.com/nanashiwan/status/1234137030084349952/photo/1'
urlp = urlparse(s)
m = re.match(r'^/(.+)/status/([^/]+)(/.+)?', urlp.path)
m.groups()
import os
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
REMOTE_DRIVER = os.environ.get('REMOTE_DRIVER')
class DynamicFetcher:
def __init__(self):