X Tutup
Skip to content

Commit 04840ed

Browse files
committed
add new titles
1 parent 9a03595 commit 04840ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+121
-1
lines changed

kamen/0008/0008.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from bs4 import BeautifulSoup
2+
from urllib import urlopen
3+
4+
r = urlopen('http://sports.sina.com.cn/nba/2015-04-23/00007584374.shtml').read()
5+
soup = BeautifulSoup(r)
6+
#print soup
7+
t = soup.find_all(id='artibody')
8+
#print t
9+
#print type(t)
10+
s=''
11+
for p in t[0].find_all("p"):
12+
s = s + p.get_text()+'\n'
13+
14+
print s
15+
16+
17+

kamen/0009/0009.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from bs4 import BeautifulSoup
2+
from urllib import urlopen
3+
r = urlopen('http://sports.sina.com.cn/nba/2015-04-23/00007584374.shtml').read()
4+
soup = BeautifulSoup(r)
5+
6+
#there is javasciript things to be cleaned.
7+
s = soup.find_all("a")
8+
for link in s:
9+
try:
10+
print link["href"]
11+
except KeyError:
12+
pass
13+

kamen/0011/filter_words.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import re
2+
3+
filter_words=''
4+
with open('filtered_words.txt','r') as f:
5+
for line in f:
6+
filter_words += line.strip()+'|'
7+
8+
filter_words = filter_words.strip('|')
9+
fw = re.compile(filter_words)
10+
11+
content= raw_input("input:")
12+
if(fw.search(content)):
13+
print "Freedom"
14+
else:
15+
print "Human Rights"
16+
17+

kamen/0011/filtered_words.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
����
2+
����Ա
3+
����Ա
4+
�쵼
5+
ţ��
6+
ţ��
7+
����
8+
����
9+
love
10+
sex
11+
jiangge
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import re
2+
3+
#sometimes dislike to use Recycling. bad.
4+
def sub_with_spark(matched):
5+
# for g in matched.groups():
6+
# print g
7+
8+
return '*' * len(matched.group(0))
9+
10+
11+
filter_words=''
12+
with open('filtered_words.txt','r') as f:
13+
for line in f:
14+
filter_words += line.strip()+'|'
15+
16+
filter_words = filter_words.strip('|')
17+
fw = re.compile(filter_words)
18+
19+
content= raw_input("input:")
20+
#print content
21+
print fw.sub(sub_with_spark, content)
22+
23+
24+
25+

kamen/0012/filtered_words.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
����
2+
����Ա
3+
����Ա
4+
�쵼
5+
ţ��
6+
ţ��
7+
����
8+
����
9+
love
10+
sex
11+
jiangge

kamen/0013/1.jpg

39.9 KB

kamen/0013/10.jpg

40.3 KB

kamen/0013/11.jpg

40 KB

kamen/0013/12.jpg

31 KB

0 commit comments

Comments
 (0)
X Tutup