Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'output': 0.05; 'append': 0.09; 'url:github': 0.09; 'subject:How': 0.10; 'python': 0.11; '>that': 0.16; 'andreas': 0.16; 'bye,': 0.16; 'interacting': 0.16; 'skip:> 20': 0.16; 'subject:URL': 0.16; 'subject:after': 0.16; 'wrote:': 0.18; 'module': 0.19; 'example': 0.22; 'url:dev': 0.24; 'header:In-Reply-To:1': 0.27; 'link.': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'here': 0.66; 'subject:get': 0.81; 'url:bitly': 0.84; 'url:links': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=hbfFR9wR9pEneTVmzkIryBiDhWMdEdr9Djl6NtA2Y3o=; b=pSjh1F+bdHBbUOefslrZ5HUGqP6FwTZrICNabINzkhWL0OfPhOCd8WxSj72VxUeoR0 /53OixELFSPQny7DjVXyaepkd0TvzHpYqSqbnKYpOppiQCflUbl+9W7HG6lCBeHMX5lS 5OahO0AcTbjhXE/cRCbutFuvGqDzlJrNlZ91kQ70Iuf5kBDwpjVF4bnAsWvjSxsV0HaF T1JSejk/A69bZ3AQYCUi885n5WL1kZ/Qqlj4MuhmRBB6qgke4L+In0hzKr9p1YcVzI72 Actix9QaQccFg/Ww13D5rp0tckvUX7+k8hvm524AbmnY/s7+tYGvv8kaNHS/Ca4DA4Hp TE1w== X-Received: by 10.205.78.5 with SMTP id zk5mr3060353bkb.25.1383241359762; Thu, 31 Oct 2013 10:42:39 -0700 (PDT) Date: Thu, 31 Oct 2013 18:42:35 +0100 From: Andreas Perstinger To: python-list@python.org Subject: Re: How to get final URL after redirection In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383242269 news.xs4all.nl 15867 [2001:888:2000:d::a6]:48096 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58198 nishant bhakta wrote: >I have a link that will redirect to any-other link and i have to work >with that final link. For example if i have a link "www.bit.ly/2V6CFi" >that will redirect to "www.google.com". Here i want that i take >"www.bit.ly/2V6CFi" and find the final redirect link and append >"#q=python" to that link and produce an output that is >"www.google.com/#q=python". For bitly links you need to use their API: http://dev.bitly.com/links.html#v3_expand There is a python module for interacting with it: https://github.com/bitly/bitly-api-python Bye, Andreas