What is the simplest URL shortener application one could write in python for the Google App Engine?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

That sounds like a challenge! From google.appengine. Ext import db from google.appengine.

Ext import webapp from google.appengine.ext. Webapp import run_wsgi_app class ShortLink(db. Model): url = db.

TextProperty(required=True) class CreateLinkHandler(webapp. RequestHandler): def post(self): link = ShortLink(url=self.request. POST'url') link.put() self.response.out.

Write("%s/%d" % (self.request. Host_url, link.key().id()) def get(self): self.response.out. Write('') class VisitLinkHandler(webapp.

RequestHandler): def get(self, id): link = ShortLink. Get_by_id(int(id)) if not link: self. Error(404) else: self.

Redirect(link. Url) application = webapp. WSGIApplication( ('/create', CreateLinkHandler), ('/(\d+)', VisitLinkHandler), ) def main(): run_wsgi_app(application) if __name__ == "__main__": main().

2 Nice indeed -- simple, clear, effective! – Alex Martelli Sep 10 '09 at 15:29 Can you provide a link to a working sample? – trusktr Mar 2 '11 at 0:41 @trusktr I wouldn't actually put up something this simple (or recommend anyone else do) - it's likely to be prone to abuse, since it has nothing to protect against abuse by spammers etc.– Nick Johnson Mar 2 '11 at 0:43.

There is a django app on github, github.com/nileshk/url-shortener. I forked it to make it more of an all encompassing site,github.com/voidfiles/url-shortener.

Similar, complete with GAE project boilerplate: https://github.com/dustingetz/vanity-redirect.

Google now as a Google Shortening API that you can use to call theres.

Dead link - please update. – ehfeng Sep 17 '11 at 17:11 1 code.google.com/apis/urlshortener/v1/get..._started. Html – Tim Fletcher Sep 24 '11 at 22:31 Thanks Tim for updating!

– ehfeng Sep 26 '11 at 15:44 One reason to write your own: you want to provide a URL shortener for your company intranet. – Maxy-B Nov 23 '11 at 19:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions