Skip to content

Instantly share code, notes, and snippets.

@olsososo
olsososo / spider.py
Last active December 20, 2015 05:09
一只简单的爬虫
# -*- coding:utf-8 -*-
import MySQLdb
import Queue
import re
import requests
import threading
import time
import sys
#!/bin/env python
# coding=utf-8
import sys
def main():
print "hello world!"
if __name__ == "__main__":
main()
@olsososo
olsososo / rss.py
Last active December 24, 2015 23:29
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# import gevent.monkey
# gevent.monkey.patch_all()
import gevent
import MySQLdb
import os
import re
P:爱智慧
S:数学
数学文化 http://www.global-sci.org/mc/
Plus http://plus.maths.org/content/
Matrix67 http://www.matrix67.com/blog/
数学习明那尔 http://www.seminarmath.com/
哆嗒数学 http://duodaa.com/index.php
善科题库 http://www.mysanco.com/tiku/
学夫子 http://xuefuzi.com/
Project Euler http://projecteuler.net/
import os
from hashlib import sha256
from hmac import HMAC
def encrypt_password(password, salt=None):
"""Hash password on the fly."""
if salt is None:
salt = os.urandom(8) # 64 bits.
assert 8 == len(salt)
1
时代周刊 http://feeds2.feedburner.com/time/topstories
彭博社 http://pub.rss.feedcry.com/fulltext/Bloomberg
凤凰资讯 http://news.ifeng.com/rss/index.xml
南方人物 http://www.bullock.cn/blogs/nfrwzk/Rss.aspx
亚洲周刊 http://feed.feedsky.com/yzzk
新闻档案馆 http://www.ohmymedia.info/feed
南风窗 http://blog.sina.com.cn/rss/1284797513.xml
Discovery http://news.discovery.com/rss/news/
南方周未 http://www.infzm.com/rss/home/rss2.0.xml
1 新闻&资讯 电玩巴士-PS3频道 http://rss.tgbus.com/ps3.xml http://ps3.tgbus.com
1 新闻&资讯 网易头条 http://news.163.com/special/00011K6L/rss_newstop.xml http://news.163.com
1 新闻&资讯 大洋热点新闻 http://rss.dayoo.com/feed/news/china.xml http://dayoo.com
1 新闻&资讯 开源中国社区最新新闻 http://www.oschina.net/news/rss http://www.oschina.net/?from=rss
1 新闻&资讯 GeekPark 捕风捉影 http://feeds.geekpark.net/ http://event.geekpark.net
1 新闻&资讯 TechWeb 每日热点推荐 RSS阅读 http://www.techweb.com.cn/rss/hotnews.xml http://www.techweb.com.cn/rss/hotnews.xml
1 新闻&资讯 资讯_四月网 http://app.m4.cn/?app=rss&controller=index&action=feed&catid=26 http://app.m4.cn?app=rss&controller=index&action=feed&catid=26
1 新闻&资讯 每日新闻_图片频道_财新网 http://photos.caixin.cn/dailynews/rss/100300265.xml http://photos.caixin.cn/dailynews/index.html
1 新闻&资讯 教育装备网企业动态 http://www.caigou.com.cn/rss/NewsRss.asp?t=1 http://www.caigou.com.cn/News/T2/list_p_1.shtml
1 新闻&资讯 JPbeta 多元化日本文化资讯站 http://feed.feedsky.com/jpbeta http://www.jpbeta.net
@olsososo
olsososo / browserPlugins.js
Created November 1, 2013 03:41
获取浏览器插件 检查是否有某个插件
function getPlugins(name){
var hasPlugin = false;
(function(){
for(var i=0;i<navigator.plugins.length;i++){
w(navigator.plugins[i].name);
if(name && navigator.plugins[i].name.toLowerCase().indexOf(name.toLowerCase()) > -1){
hasPlugin = true;
}
@olsososo
olsososo / client.js
Created November 1, 2013 08:08
客户端信息检测
var client = function(){
var engine = {
ie: 0,
gecko: 0,
webkit: 0,
khtml: 0,
opera: 0,
ver: null
};
@olsososo
olsososo / tailor.py
Last active December 30, 2015 05:48
# -*- coding:utf-8 -*-
from __future__ import division
import sys
import math
import string
from PIL import Image
from collections import Counter
def q():