Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

register some communities and handle exceptions

  • Loading branch information...
commit 3bc42768e5d4314ddf33491915f2888a73ac8993 1 parent c4aff5d
@takano32 authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 SkypeKit/Bot/nicolv.py
View
17 SkypeKit/Bot/nicolv.py
@@ -4,8 +4,13 @@
# author: takano32 <tak@no32 dot tk>
#
communities = [
- 'co80029', # dark
- 'co571107', #test
+ 'co80029', # Dark
+ 'co1513375', # Light
+ 'co9320', # プログラミング生放送
+ 'co244678', # 神回
+ # 'co23655', # アリーナ
+ # 'co1024634', # まるはに
+ # 'co405315', # プログラマ
]
import urllib2
@@ -34,7 +39,13 @@
while True:
for community in communities:
url = base_url + community
- html = opener.open(url).read()
+ try:
+ html = opener.open(url).read()
+ except Exception as err:
+ print err
+ print community
+ print
+ continue
soup = BeautifulSoup(html)
title = soup.find('title').text
link = soup.find('a', {'class': 'community'})
Please sign in to comment.
Something went wrong with that request. Please try again.