~super-friends/friends/trunk-next

Viewing all changes in revision 200.

  • Committer: Robert Bruce Park
  • Date: 2013-03-29 07:12:24 UTC
  • Revision ID: robert.park@canonical.com-20130329071224-5maux8xth00qi3i9
Add support for durl.me, with test coverage.

This required implementing some regex for easily grabbing URLs out of
JSON. This may be a little bit unorthodox, however had I used the
traditional json parser, I would have been stuck trying to traverse a
service-specific JSON data structure, and I wanted to write some code
that was much more generally-applicable. So this JSON code, as
written, can grab URLs safely from any possible JSON format, whether
the URL is stored in a list, or a dict, or a list of dicts, or
whatever other JSON-ish format they might want to throw at us... it
just ignores all that and returns the shortened URL directly.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: