tflink / python-yourls Goto Github PK
View Code? Open in Web Editor NEWSimple Python client for the YOURLS URL shortener
Home Page: http://tflink.github.com/python-yourls
License: GNU General Public License v2.0
Simple Python client for the YOURLS URL shortener
Home Page: http://tflink.github.com/python-yourls
License: GNU General Public License v2.0
python-yourls allows for empty urls during construction which is not valid.
If an empty url is used, exceptions are thrown when shorting a url.
See https://fedorahosted.org/autoqa/ticket/383 for an example failure
I tried to shorten a URL with an apostrophe in the page's default title (i.e. the title parameter was not manually set, although this also causes the below error)
For example, shortening this URL causes the error because of the apostrophe in the title: http://www.bbc.co.uk/news/uk-25482736
{ "url": { "keyword": "0qn-7", "url": "http://www.bbc.co.uk/news/uk-25482736", "title": "BBC News - Abbas Khan death: British doctor\'s body to be flown to UK", "date": "2013-12-22 02:37:49", "ip": "REDACTED" }, "status": "success", "message": "http://www.bbc.co.uk/news/uk-25482736 added to database", "title": "BBC News - Abbas Khan death: British doctor\'s body to be flown to UK", "shorturl": "REDACTED/0qn-7", "statusCode": 200 }
Traceback (most recent call last):
File "URLShortener.py", line 22, in <module>
shorturl = client.shorten(longurl, keyword=keyw, title=title)
File "build/bdist.macosx-10.8-x86_64/egg/yourls/client.py", line 136, in shorturl
File "build/bdist.macosx-10.8-x86_64/egg/yourls/client.py", line 104, in _base_request
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Invalid \escape: line 1 column 133 (char 132)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.