url

Convert URL to AbsolutePath

Is there any easy way to convert a URL that contains to two-byte characters into an absolute path? The reason I ask is I am trying to find resources like this: URL url=getClass().getResources("/getresources/test.txt"); String path=url.toString(); File f=new File(path); The program can't find the file. I know the path contain '%20' fo...

When I generate the src of an img tag, using php, it strips the forward slash at the end of the tag. Anyone come across this before?

If I have the path to an image stored in $thumbPath and I put that as the img tag's src it strips the end "/" from the tag. Does anyone have any ideas about this? <img src="<?php echo $thumbPath; ?>" /> // <img src="path/to/file/foo.jpg"> Thanks ...

Python URL download,

The Code below gives me "none", How Can I fix? Using python 2.6 import urllib URL = "http://download.finance.yahoo.com/d/quotes.csv?s=%s&amp;f=sl1t1v&amp;e=.csv" symbols = ('GGP', 'JPM', 'AIG', 'AMZN','GGP', 'JPM', 'AIG', 'AMZN') #symbols = ('GGP') def fetch_quote(symbols): url = URL % '+'.join(symbols) fp = urllib.urlopen(url...

Python change data into sequence...

The "idata" I pulled from this URL needs to be turned into a sequence, how do i turn it into a sequence import urllib, csv URL = "http://download.finance.yahoo.com/d/quotes.csv?s=%s&amp;f=sl1vt1&amp;e=.csv" symbols = ('GGP', 'JPM', 'AIG', 'AMZN','GGP', 'JPM', 'AIG', 'AMZN') #symbols = ('GGP',) def fetch_quote(symbols): url = URL %...

Downloading a web page. OK with wget, fails with java

Hi all, I'm trying to download the following page: http://structureddata.wikispaces.com/Test wget without any option fails: wget "http://structureddata.wikispaces.com/Test" (...) connect to session.wikispaces.com insecurely, use `--no-check-certificate' with --no-check-certificate, it works wget --no-check-certificate "http://struc...

& symbol encoded to %2526 in url

I need to replace the encoded value for the & sign in my url so the search query is successful. Im struggling to copy a similar method from the solution in this post for a query string such as below. lovelakedistrict.com/result/?q=Brookfield+Bed+%2526+Breakfast I want it to be like so lovelakedistrict.com/result/?q=Brookfield+Bed+&+Br...

Why browser's address bar is unchanged when using AJAX ?

I am using AJAX/JSON combination in Zend Framework. Whenever I click any link in my application, AJAX request is called and content is loaded successfully in DIVs But the address bar is unchanged. How to change address bar according to current active action. Here is My Working Code: When I use http://practice.dev/ my index.phtml file...

SQL server 2008 - storing and searching URL (web address)

I'm facing a decision on how to store URL (bookmark) in a table. I have following requirements: Customer must be able to search the title of a bookmark. I decided to use a FTS with ranking option for this requirement Customer must be able to search an address Here is where I have doubts on how to store URL. First of all, UR...

Clojure building of URL from constituent parts

In Python I would do the following: >>> q = urllib.urlencode({"q": "clojure url"}) >>> q 'q=clojure+url' >>> url = "http://stackoverflow.com/search?" + q >>> url 'http://stackoverflow.com/search?q=clojure+url' How do I do all the encoding that's done for me above in Clojure? In other words, how do I do something akin to the following...

What's this kinda url called?

http://admin:[email protected]/videostream.cgi I've never known that user/pass can be set directly in the url,anyone can explain how it works,is it standard, or give a term to google with? ...

Simple HTML internal link question

Weired, simple HTML stuff didn't work as expected. On page 1, a Railo script named page1.cfm, it has the following line: <a href="page2.html#part2">Go To Page 2, Part 2</a> so, we expect the link would bring the user to the page2.html page's Part 2 section and yes this section and the internal link tag exists on page2.html. But tested w...

question about reading data from urls on iphone/ipad

I have an app which uses a UIWebView to load a webpage, I then parse the links (triggered by a call of webViewDidFinishLoad) from that webpage and load all these html files using NSString initWithContentsOfURL. This works, but it takes forever to load the links... even tho I've clocked how long each initWithContentsOfURL call takes and t...

Handling various types of URL redirects

Generally, when writing HTTP client software, the HTTP protocol provides sufficient information for how to handle redirected URLs. Specifically, if an HTTP request returns a redirect code of 302 or 307, the redirect should be considered temporary and the client should continue to use the original URL. However, a redirect code of 301 in...

extract YouTube URL from random text in PHP

Im trying to extract a YouTube link from just random text. e.g. This is some random text and url is http://www.youtube.com/watch?v=-d3RYW0YoEk&feature=channel and I want to pull this URL out of this text in PHP. Can't seem to figure it out. Found a solution in another language but don't know how to convert it. Thanks for the help....

PHP Replace Variables in URL

Hello, I wondered if it was possible to rewrite a URL so designed for the rewrite wrote in htaccess e.g. I have the URL: http://example.com/page.php?page=5&amp;action=something But I want to change the URL to: example.co m/page/5/something This is just for the href, the htaccess bit is solved. ...

Is it possible to have a Struts2 application without using any suffixes like action or do?

By default, Struts 2 uses the suffix .action to represent action URLs. So, even if I want to get to a login page, I need to use a URL something like : http://mysite.com/login.action. But I feel the above URL is not flexible and not SEO friendly. So, is there any way to avoid the .action suffix or any suffixes completely and just use pla...

parsing an url for crawler

hello, i am writting an small crawler that extract some 5 to 10 sites while getting the links i am getting some urls like this ../tets/index.html if it is /test/index.html we can add with base url http://www.example.com/test/index.html what can i do for this kind of urls. ...

URL rewrite in .htaccess file

Hi all, I have two problems in my current .htaccess. The script below works but has a limitation RewriteRule ^products/([0-9])$ /products/$1/ [R] RewriteRule ^products/([0-9])/$ /viewad.php?adid=$1 Limitation: if adid, is more than 10. it fails. I want it to have whatever number still there and work. my current solution was to add...

PHP regex for url validation, filter_var is too permisive

First lets define a "URL" according to my requirements. The only protocols optionally allowed are http:// and https:// then a mandatory domain name like stackoverflow.com then optionally the rest of url components (path, query, hash, ...) For reference a list of valid and invalid url's according to my requirements VALID stackoverf...

Encoding data in URL for efficient transport

Hello, I'm searching for a library that can encode data in URL, because using plain "&param=value is" inefficient. I'm looking for a library that will accept a defined set of parameters and will encode it into a format that is safe to sent over HTTP GET request. I will be using this to send tracking events from my player to the backend...