Code Monkey home page Code Monkey logo

nurl's Introduction

nurl

nurl is an open-source URL shortening application written in Python, built upon Pyramid and MongoDB.

It is licensed under BSD 3-Clause <http://www.opensource.org/licenses/BSD-3-Clause>.

Quick Installation

  1. Download the files from http://github.com/gustavofonseca/nurl
  2. Run python setup.py develop
  3. Edit development.ini to enter MongoDB configs
  4. Run pserve development.ini

This is a typical Pyramid app installation. For more details, take a look at: http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/

https://secure.travis-ci.org/gustavofonseca/nurl.png?branch=master

nurl's People

Contributors

gustavofonseca avatar

Stargazers

SHIMIZU Taku avatar Fabio Batalha avatar  avatar Luiz Boaretto avatar Luciano Ramalho avatar

Watchers

 avatar James Cloos avatar

nurl's Issues

Set a timeout to URL validation request

When generating short urls, we always validate the URL existence, but a max timeout is needed in order to isolate possible requests to non-responding servers.

Erro ao encurtar a URL: http://scielo.org

Traceback (most recent call last):
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/pyramid_debugtoolbar-1.0.2-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
    result = handler(request)
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/router.py", line 164, in handle_request
    response = view_callable(context, request)
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/config/views.py", line 333, in rendered_view
    result = view(context, request)
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/config/views.py", line 471, in _requestonly_view
    response = view(request)
  File "/var/www/ref_scielo_org/nurl/nurl/views.py", line 16, in home
    short_url = url_shortener(request).text
  File "/var/www/ref_scielo_org/nurl/nurl/views.py", line 29, in url_shortener
    url_handler = Url(request, url=incoming_url)
  File "/var/www/ref_scielo_org/nurl/nurl/domain.py", line 100, in __init__
    u = urllib2.urlopen(url)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/var/www/ref_scielo_org/nurl-env/lib/python2.7/site-packages/newrelic-1.2.1.265-py2.7.egg/newrelic/api/external_trace.py", line 73, in __call__
    return self._nr_next_object(*args, **kwargs)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 1173, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/local/Python-2.7/lib/python2.7/urllib2.py", line 1148, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -5] No address associated with hostname>

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.