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
| from lxml.html import fromstring | |
| def strip_tags(html): | |
| """ | |
| htmlデータからタグ除去したテキストデータを抽出する | |
| ※scriptタグとstyleタグを無視 | |
| Args: | |
| html: str, パースしたいhtmlデータ | |
| Returns: | |
| text: str, タグ除去されたテキストデータ |
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:utf-8 -*- | |
| import asyncore | |
| import socket | |
| import os | |
| import sys | |
| addresses = [ | |
| ('localhost',252525), # dispatcher | |
| ] |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from lxml.html import fromstring | |
| import urllib | |
| result_links = [] | |
| urls = [ | |
| 'http://www.startups-japan.com/clients/index/page:1/', |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from lxml.html import fromstring | |
| import urllib,urllib2 | |
| import re | |
| result_links = [] | |
| urls = [ |
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
| /* | |
| #------------------------------------------------------------------------------- | |
| # Name: grant naruto | |
| # Purpose: ircBot-console用、自動なると付加スクリプト | |
| # Version: 0.1 | |
| # | |
| # History: | |
| # 0.1 初リリース | |
| # | |
| # Author: PyYoshi |
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 | |
| #!/usr/bin/env python | |
| mes = "python prpr" | |
| block_size = 32 | |
| padding = 'x' | |
| pad = lambda s: s + (block_size - len(s) % block_size) * padding | |
| print pad(mes) |
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 | |
| import socket | |
| def find_free_port(): | |
| """ 空きポートを見つける関数 """ | |
| serversock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| serversock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
| serversock.bind(('127.0.0.1',0)) | |
| address, port = serversock.getsockname() | |
| serversock.close() |
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:utf-8 | |
| import base64 | |
| from itertools import cycle,izip | |
| def xor_enc_base64(ss, key): | |
| key = cycle(key) | |
| return base64.b64encode(''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(ss, key))) | |
| def xor_dec_base64(ss, key): | |
| key = cycle(key) |