url

NSURLErrorBadURL error

My iphone app called Google Local Search(non javascript version) to behave some search business. Below is my code to form a url: NSString *url = [NSString stringWithFormat:@"http://ajax.googleapis.com/ajax/services/search/local?v=1.0&q=%@", keyword]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; ...

Download image from url

Hi , I am trying to download the image from the url http://a3.twimg.com/profile_images/414797877/05052008321_bigger.jpg I am using the following code, but image is not saved. I want to know what i m doing wrong. NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/414797877/050...

Asp.NET link: Page losing port number

In this asp.net page, there is a link that leads to another page in a certain subfolder, It has always worked. Recently, for technical reasons (irrelevant) , the port number had to be changed (80 to 81). Every link keeps working, but there is ONE that doesn't keep the port number no matter what. <asp:HyperLink runat="server" Text="link...

decode tinyurl in R to get full url path?

Is there a way to decode tinyURL links in R so that I can see which web pages they actually refer to? ...

Add params to given URL in Python

Suppose I was given by some URL. It might already have GET parameters (e.g. http://example.com/search?q=question) or not (e.g. http://example.com/). And now I need to add some parameters to it like {'lang':'en','tag':'python'}. In first case I'm going to have http://example.com/search?q=question&amp;lang=en&amp;tag=python and in second ...

How do I forward a request to a different url in python

I have been looking for the syntax to redirect a special url to a remote server to do some XSS testing. Any ideas? import SimpleHTTPServer import SocketServer class myHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): print self.path if self.path == '/analog': -------------------->return "http://...

Xcode iPhone Programming: Loading a jpg into a UIImageView from URL

My app has to load an image from a http server and displaying it into an UIImageView How can i do that?? I tried this: NSString *temp = [NSString alloc]; [temp stringwithString:@"http://192.168.1.2x0/pic/LC.jpg"] temp=[(NSString *)CFURLCreateStringByAddingPercentEscapes( nil, (CFStringRef)temp, NULL, ...

URL Slugs: Redirects or 404s?

Some sites, like here at SO, allow 'bogus' slugs in the URL. Before implementing URL slugs on my site, I have a question of 'best practices'... Given a structure like example.com/123/article-slug-here/, if my site allows bogus slugs by querying on the ID - Should I ... just do a redirect to the appropriate/canonical URL (verifyi...

How to match only extensionless URLs?

I want a regex expression which only match extensionless url. In otherwords if an extension is present in url then completely ignore it. /(.+)/(.+) this will match an URL both with and without extension. www.site.com/sports/cricket should match www.site.com/sports/cricket.aspx shouldn't match Thanks in advance ...

Open an Excel htm URL via iFrame in a separate browser

I have some URLs in an Excel file which I have saved as a .htm (webpage) file. I then view these in a browser via our wiki (MediaWiki). This is done using an iFrame embedded in the wiki page. So, just for clarity, the link is in a htm file viewed via an iFrame in a wiki page. When I click on that link, it opens inside the iFrame. Wh...

Redirecting a HTTP rqueust and response code/headers

Hi, I have a loosely coupled web app (one part uses PHP, the other uses WGSI). The WSGI/python framework shares the authentication with the PHP app, meaning that generally, the user should Log in via the PHP interface Now the user can access any of the WSGI pages [this part works if the user has logged in] What I want to do though, ...

How can I use JavaScript to match a string inside the current URL of the window I am in?

Hi, I have used the excellent gskinner.com/RegExr/ tool to test my string matching regex but I cannot figure out how to implement this into my JavaScript file to return true or false. The code I have is as follows: ^(http:)\/\/(.+\.)?(stackoverflow)\. on a url such as http://stackoverflow.com/questions/ask this would match (accordin...

Requested URL is changing

Hi, I have a website, at localhost:82 when I type this into IE, it comes up with a 404 error and the requested URL is localhost:80/wwwroot, which is not at all what I requested. There is no URL rewrite set up. I have tried to set up a tracing rule to see what is happening, however, the instructions at http://learn.iis.net/page.aspx/26...

want to add url links to .csv datafeed using python

Hi all ive looked through the current related questions but have not managed to find anything similar to my needs. Im in the process of creating a affiliate store using zencart - now one of the issues is that zencart is not designed for redirects and affiliate stores but it can be done. I will be changing the store so it acts like a...

Apply relative URL to an absolute URL

I have an absolute URL, and the URL that a link on that page points to. Is there a builtin function to apply a relative URL to an absolute URL? Ie. "http://example.com/some/url", "/some/url/I/want/to/go/to" => "http://example.com/some/url/I/want/to/go/to" ...

php regular expression to match specific url pattern

I'd like to "grab" a few hundred urls from a few hundred html pages. Pattern: <h2><a href="http://www.the.url.might.be.long/urls.asp?urlid=1" target="_blank">The Website</a></h2> ...

Why does this VBS scheduled task (to call a URL) not work in Windows Server 2008?

This same script worked in older server OS environments, and even on my desktop; and allows me to kick off a nightly process on my website's URL. It simply will not execute the URL in my Windows Server 2008 environment. It does not generate any errors, claiming task completion I can pull the same URL up just fine in the server's web...

Java URI.resolve

I'm trying to resolve two URIs, but it's not as straightforward as I'd like it to be. URI a = new URI("http://www.foo.com"); URI b = new URI("bar.html"); The trouble is that a.resolve(b).toString() is now "http://www.foo.combar.html". How can I get away with that? ...

Redirecting a url - Wordpress

Hi, I'm working on a wordpress site, with a blog post that ends like: http://www.blog.com/?p=2. However, I need to change the wordpress settings so that posts end in the following format: http://www.blog.com/02/11/2009/this-is-a-post. When I do this, obviously it will break outside links to the post that is named http://www.blog.com/?p...

UIApplication openUrl not working with formatted NSString

I have the following code to open google maps: NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@, Anchorage, AK",addressString]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; But it doesn't work and there is no error. It just doesn't open. ...