Skip to content

Instantly share code, notes, and snippets.

View flyfy1's full-sized avatar

Song Yangyu flyfy1

View GitHub Profile
// in item order page
deliveryInfo = document.querySelector("#appOrders > div > table > tbody > tr > td > ul > li > div")
deliveryCompany = deliveryInfo.querySelector("span:nth-child(2)").innerText
deliveryID = deliveryInfo.querySelector("span:nth-child(4)").innerText
itemName = document.querySelector("#appOrders > div > table > tbody > tr > td > ul > li > table > tbody > tr > td.header-item.order-item-info > div > div.item-meta > a").innerText
totalPrice = document.querySelector("#appAmount > div > table > tbody > tr > td.total-count > div:nth-child(1) > div:nth-child(4) > table > tbody > tr > td > span > div").innerText.split('¥')[1]
console.log(`${itemName}\t${deliveryCompany}\t${deliveryID}\t\t\t\t${totalPrice}`)
@flyfy1
flyfy1 / date_transformer
Last active August 11, 2020 16:05
file for parse from `ISO 8601` date into `yyyy-MM-dd HH:mm:ss` so that it's parsable by MySQL when imported as CSV
#!/usr/bin/ruby
source_path = ARGV[0]
target_path = ARGV[1]
puts "going to process file: #{source_path}"
puts "going to create file: #{target_path}"
fail "source file non edist" unless File.exist?(source_path)
fail "target file already edist" if File.exist?(target_path)