Skip to content

Instantly share code, notes, and snippets.

@brianpow
brianpow / a7020a48
Last active February 14, 2017 06:25
http://phonedl.ota.lenovomm.com/dls/v6/A7020a48_S122_160405_ROW_TO_A7020a48_S125_160419_ROW_WC8B95A21E.zip
http://phonedl.ota.lenovomm.com/dls/v6/A7020a48_S259_160721_ROW_TO_A7020a48_S312_160926_ROW_WC4B1E7903.zip
http://phonedl.ota.lenovomm.com/dls/v6/A7020a48_S312_160926_ROW_TO_A7020a48_S318_161128_ROW_WC04A2F728.zip
@brianpow
brianpow / bookmarklet-iherb.com-parser.js
Last active October 3, 2017 15:17
Create a textarea with price and product details in tab-separated format in current category of www.iherb.com
(function($) {
var parse = function($$) {
var category = $$.find("h1.sub-header-title").get(0).childNodes[0].nodeValue.trim() || ""
return $$.find("div.container-fluid-bs > div.row:odd").map(function() {
let $li = $("li", this)
let data = [category,
$("div.product-title", this).text().trim(),
$("div.price", this).text().trim(),
$("div.product-discount-container span", this).text().trim()
@brianpow
brianpow / bookmarklet-price.com.hk-parser.js
Last active October 3, 2017 15:16
Create a textarea with price and product details in tab-separated format in current category of www.price.com.hk
(function($) {
var parse = function($$) {
console.log("parse")
var brands = $$.find("select[name=brand] option").map(function() {
return this.value
}).get() || []
brands.shift()
var category = $$.find("div.nav-menu").text().trim()
//https://www.mchk.org.hk/english/list_register/list.php?&type=L
(function($) {
var parse = function($$) {
return $$.find("table[cellpadding=4] tr").map(function(i) {
if (i === 0) return ""
let $td = $("td", this)
let data;
if ($td.eq(0).attr("headers") === "qualification") {
data = ["", "", "", "", "",
$td.eq(0).find("span:eq(0)").get(0).childNodes[0].data,
//For https://www.dpreview.com/products/search/cameras
(function($) {
var all = []
var parse = function() {
$("td.info").each(function() {
all.push([
$("div.name", this).text(),
$("div.announcementDate", this).text(),
$("div.prices", this).text(),
].concat($("div.shortProductSpecs", this).text().split("|")).join("\t"))
@brianpow
brianpow / bookmarklet-taobao-dump.js
Created September 28, 2017 15:33
A snippet to dump the order history from taobao.com. Please jQuerify the page first.
(function($) {
parse = function(data, textStatus, jqXHR) {
console.log(data)
orders = data.mainOrders
rows = []
for (let mOrder of orders) {
header = []
body = []
header = [mOrder.id,
(function($) {
t = null
checkResult = function(coupon, coupons) {
let msg = $("#allcoupon_msg").text()
if (msg == "") {
t = setTimeout(checkResult, 500, coupon, coupons)
console.log(coupon + " wait for 500ms")
} else {
$("#allcoupon_msg").html("")