import urllib2, json
from pprint import pprint
jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'1',
'method':'aria2.getGlobalStat',
'params':['token:token']})
c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
pprint(json.loads(c.read()))
This file contains 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
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: gray; icon-glyph: folder-open; | |
const APPTABLE = new UITable() | |
const FM = FileManager.local() | |
const OFFSET = 2 | |
const VOLICON = ["🏡", "📕", "📗", "📘", "📙"] | |
var ACTIONROW | |
var REGISTER | |
var TIMER = new Timer() |
This file contains 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
## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ## | |
## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ## | |
## 添加了@和默认启用的选项都是系统需要调用的,请不要随意改动否则可能无法正常运行 | |
## 文件保存相关 ## | |
# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置 | |
# 此项 OS X 无法使用 $HOME 及 ~/ 设置路径 建议使用 /users/用户名/downloads | |
dir=/Users/ashfinal/Downloads | |
# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.github.aria2</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<false/> |
This file contains 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
# -*- coding:utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
import time | |
driver = webdriver.Safari() | |
driver.get("http://www.bing.com") | |
assert "Bing" in driver.title | |
elem = driver.find_element_by_name("q") |
This file contains 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 re | |
import os | |
import urllib | |
import requests | |
from bs4 import BeautifulSoup | |
from multiprocessing import Pool | |
initurl = 'http://www.03122.com/xinggan/12374/' | |
baseurl = os.path.split(initurl)[0] |
This file contains 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
-- Catch fn-h and convert it to a left arrow key. | |
function catcher(event) | |
if event:getFlags()['fn'] and event:getCharacters() == "h" then | |
print("fn-h!") | |
return true, {hs.eventtap.event.newKeyEvent({}, "left", true)} | |
end | |
return false | |
end | |
local tapper=hs.eventtap.new({hs.eventtap.event.types.keyDown}, catcher):start() |