skip to navigation
skip to content

Not Logged In

newslynx-url 0.1.0

Tools for parsing, extracting, reconciling, and unshortening urls

A newslynx-opinionated collection of utilities for dealing with urls.

Install

pip install newslynx-url

Test

requires nose

nosetests

Usage

This module contains various methods that are used throughout newslnyx-core. but the main functions are unshorten_url, is_article_url, and prepare_url:

from newslynx_url import (
  unshorten_url, is_article_url, prepare_url
)

print unshorten_url('bit.ly/1j3SrUC')
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/

print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism'
  )
# True

print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
  pattern = r'.*towcenter\.org/blog/.*'
)
# True

import re
pattern = re.compile(r'.*towcenter\.org/blog/.*')
print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
  pattern = pattern
)
# True

print prepare_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/?q=lfjad&f=lkfdjsal'
  )
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism
 
File Type Py Version Uploaded on Size
newslynx-url-0.1.0.macosx-10.9-intel.exe (md5) MS Windows installer any 2014-06-06 76KB
newslynx-url-0.1.0.tar.gz (md5) Source 2014-06-06 7KB
  • Downloads (All Versions):
  • 61 downloads in the last day
  • 348 downloads in the last week
  • 1144 downloads in the last month