You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This version was forked by Ian Ozsvald in January 2013 and released to PyPI, some bugs were fixed, a few minor changes to functionality added:
13
-
https://github.com/ianozsvald/twitter-text-python
14
-
15
-
PyPI release:
16
-
http://pypi.python.org/pypi/twitter-text-python/
17
-
18
-
The original ttp comes from Ivo Wetzel (Ivo's version no longer supported):
19
-
https://github.com/BonsaiDen/twitter-text-python
20
-
21
-
Usage::
22
-
23
-
>>> import ttp
24
-
>>> p = ttp.Parser()
25
-
>>> result = p.parse("@ianozsvald, you now support #IvoWertzel's tweet parser! https://github.com/ianozsvald/")
26
-
>>> result.reply
27
-
'ianozsvald'
28
-
>>> result.users
29
-
['ianozsvald']
30
-
>>> result.tags
31
-
['IvoWertzel']
32
-
>>> result.urls
33
-
['https://github.com/ianozsvald/']
34
-
>>> result.html
35
-
u'<a href="http://twitter.com/ianozsvald">@ianozsvald</a>, you now support <a href="http://search.twitter.com/search?q=%23IvoWertzel">#IvoWertzel</a>\'s tweet parser! <a href="https://github.com/ianozsvald/">https://github.com/ianozsvald/</a>'
36
-
37
-
If you need different HTML output just subclass and override the ``format_*`` methods.
38
-
39
-
You can also ask for the span tags to be returned for each entity::
40
-
41
-
>>> p = ttp.Parser(include_spans=True)
42
-
>>> result = p.parse("@ianozsvald, you now support #IvoWertzel's tweet parser! https://github.com/ianozsvald/")
0 commit comments