本文整理汇总了Python中pyfibot.modules.module_urltitle.init函数的典型用法代码示例。如果您正苦于以下问题:Python init函数的具体用法?Python init怎么用?Python init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_two
def test_two():
msg = "http://fi.wikipedia.org/wiki/DTMF"
module_urltitle.init(bot)
eq_(
("#channel", u"Title: DTMF on puhelinlaitteissa käytetty numeroiden äänitaajuusvalintatapa."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例2: test_wiki_en
def test_wiki_en():
msg = "http://en.wikipedia.org/wiki/IPhone"
module_urltitle.init(bot)
eq_(
("#channel", "Title: iPhone is a line of smartphones designed and marketed by Apple Inc."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例3: test_wiki_fi
def test_wiki_fi():
msg = "http://fi.wikipedia.org/wiki/Kimi_Räikkönen"
module_urltitle.init(bot)
eq_(
("#channel", "Title: Kimi-Matias Räikkönen on suomalainen autourheilija ja Formula 1:n maailmanmestari."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例4: test_iltalehti
def test_iltalehti():
msg = "http://www.iltalehti.fi/ulkomaat/2013072917307393_ul.shtml"
module_urltitle.init(bot)
eq_(
("#channel", "Title: Saksassa syntyi jättivauva - yli kuusi kiloa!"),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例5: test_eleven
def test_eleven():
msg = "http://en.wikipedia.org/wiki/Edison_Arantes_do_Nascimento"
module_urltitle.init(bot)
eq_(
("#channel", u"Title: Edson Arantes do Nascimento, better known as Pelé, is a retired Brazilian footballer."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例6: test_iltasanomat
def test_iltasanomat():
msg = "http://www.iltasanomat.fi/viihde/art-1288596309269.html"
module_urltitle.init(bot)
eq_(
("#channel", "Title: Muistatko Mari Sainion juontaman sarjan, josta sai palkinnoksi isdn-liittymän?"),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例7: test_seven
def test_seven():
msg = "http://en.wikipedia.org/wiki/Ramon_Llull"
module_urltitle.init(bot)
eq_(
("#channel", u"Title: Ramon Llull was a Majorcan writer and philosopher, logician and a Franciscan tertiary."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例8: test_liveleak
def test_liveleak():
regex = "Title: (.*?) by (.*?) \[%s views - Jul-23-2013 - tags\: sword, cut, hand, watermelon, fail\]" % (
views_str_regex
)
msg = "http://www.liveleak.com/view?i=f8e_1374614129"
module_urltitle.init(bot)
check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
示例9: test_six
def test_six():
msg = "http://fi.wikipedia.org/wiki/Birger_Ek"
module_urltitle.init(bot)
eq_(
("#channel", u"Title: Rolf Birger Ek oli suomalainen lentäjä ja Mannerheim-ristin ritari."),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例10: test_youtube
def test_youtube():
regex = "Title: (.*?) by (.*?) \[%s - %s views - %s( - age restricted)?\]" % (
lengh_str_regex,
views_str_regex,
age_str_regex,
)
msg = "http://www.youtube.com/watch?v=awsolTK175c"
module_urltitle.init(bot)
check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
示例11: test_eight
def test_eight():
msg = "http://en.wikipedia.org/wiki/Lazarus_of_Bethany#In_culture"
module_urltitle.init(bot)
eq_(
(
"#channel",
u"Title: Lazarus of Bethany, also known as Saint Lazarus or Lazarus of the Four Days, is the subject of a prominent miracle attributed to Jesus in the Gospel of John, in which Jesus restores him to life four d...",
),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例12: test_stackoverflow
def test_stackoverflow():
msg = "http://stackoverflow.com/questions/6905508/python-search-html-document-for-capital-letters"
module_urltitle.init(bot)
eq_(
(
"#channel",
"Title: Python search HTML document for capital letters - 0pts - python/regex/coda/letters/capitalize",
),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例13: test_vimeo
def test_vimeo():
regex = "Title: (.*?) by (.*?) \[%s - %s likes - %s views - %s]" % (
lengh_str_regex,
views_str_regex,
views_str_regex,
age_str_regex,
)
msg = "http://vimeo.com/29996808"
module_urltitle.init(bot)
check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
示例14: test_one
def test_one():
msg = "https://en.wikipedia.org/wiki/Hatfield–McCoy_feud"
module_urltitle.init(bot)
eq_(
(
"#channel",
u"Title: The Hatfield–McCoy feud involved two families of the West Virginia–Kentucky area along the Tug Fork of the Big Sandy River.",
),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)
示例15: test_five
def test_five():
msg = "http://fi.wikipedia.org/wiki/David_Eddings"
module_urltitle.init(bot)
eq_(
(
"#channel",
u"Title: David Carroll Eddings oli yhdysvaltalainen kirjailija, joka kirjoitti useita suosittuja fantasiakirjoja.",
),
module_urltitle.handle_url(bot, None, "#channel", msg, msg),
)