GithubHelp home page GithubHelp logo

tflink / python-yourls Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 12.0 103 KB

Simple Python client for the YOURLS URL shortener

Home Page: http://tflink.github.com/python-yourls

License: GNU General Public License v2.0

Python 100.00%

python-yourls's People

Contributors

tflink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-yourls's Issues

Apostrophe in page title causes error

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.