- iokde.com
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
| # coding:utf8 | |
| # pip install simplejson | |
| # pip install beautifulsoup4 | |
| # sudo apt-get install python-bs4 | |
| import urllib3 | |
| import re | |
| from bs4 import BeautifulSoup | |
| url = "http://qingmang.me/magazines/" | |
| print "first method" |
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
| require 'date' | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| argv = ARGF.argv | |
| gap = argv[0].to_s.to_i || 0 | |
| day = (Date.today - gap ).strftime("%Y-%m-%d") | |
| puts | |
| adx_requests=Hash.new(0) | |
| daydirs = Dir["log/*watch*"].sort |
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
| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| i = 0 | |
| f=File.open("us_ip_result.txt", "a+") | |
| File.open("us.log" ).each do |line| | |
| i = i + 1 | |
| ip = line.split(",").last.gsub(/\s+/, "") | |
| if ip != "" |
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
| var parser = require('xml2json'); | |
| var fs = require('fs'); | |
| content = fs.readFileSync('mmg.xml') | |
| console.log("content is:",content) | |
| // xml to json | |
| var xml =content; | |
| var json = parser.toJson(xml); //returns a string containing the JSON structure by default | |
| console.log(json); | |
| json = JSON.parse(json) |
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
| require 'date' | |
| (Date.parse("20160416")..Date.parse("20160430")).each do |day | | |
| day= day.strftime("%Y%m%d") | |
| #exec( "echo ruby send-dev2es.rb #{day}" ) | |
| exec_command = " ruby send-dev2es.rb #{day}" | |
| system exec_command | |
| sleepcmd = "sleep 0.05" | |
| system sleepcmd | |
| end |
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
| require 'rufus-scheduler' | |
| require 'date' | |
| #实现上传统计任务,第一个任务执行完成后输出结果,第二个任务对输出结果处理上传 | |
| #两个任务分别重复执行一次,防止执行失败。 | |
| scheduler = Rufus::Scheduler.new | |
| puts Time.new | |
| scheduler.cron '25 0,3 * * *' do |
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
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| type gzipResponseWriter struct { |
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "log" | |
| "mime/multipart" | |
| "net/http" | |
| "os" |
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
| package utils | |
| import "crypto/cipher" | |
| type ecb struct { | |
| b cipher.Block | |
| blockSize int | |
| } | |
| func newECB(b cipher.Block) *ecb { |
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
| ### yo probe esta: | |
| —– BEGIN LICENSE —– | |
| J2TeaM | |
| 2 User License | |
| EA7E-940282 | |
| 45CB0D8F 09100037 7D1056EB A1DDC1A2 | |
| 39C102C5 DF8D0BF0 FC3B1A94 4F2892B4 | |
| 0AEE61BA 65758D3B 2EED551F A3E3478C | |
| C1C0E04E CA4E4541 1FC1A2C1 3F5FB6DB |