Questions tagged [url]

A Uniform Resource Locator (URL) is a Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it.

Filter by
Sorted by
Tagged with
21
votes
2answers
10k views

Spliterator implementation

I'm trying to post a little tutorial on the new Spliterator class. There are many tutorials these days on using stream starting from a standard Java collection, but ...
15
votes
2answers
2k views

PHP URL Shortener

I just developed a URL shortener. index.php: ...
15
votes
2answers
24k views

Joining url path components intelligently

I'm a little frustrated with the state of url parsing in python, although I sympathize with the challenges. Today I just needed a tool to join path parts and normalize slashes without accidentally ...
14
votes
3answers
28k views

Constructing a query string using StringBuilder

I speedily wrote a bunch of crappy checks, to check whether strings are empty, in order to build a query string. ...
14
votes
2answers
727 views

HTTP request path parser

I have written a method to tokenize HTTP request paths such as /employee/23/edit: ...
12
votes
1answer
22k views

Get params from a URL

I want to write my own version of HttpUtility.ParseQueryString, because it is not included in the .NET Framework Client Profile. My code is pretty straightforward ...
11
votes
2answers
8k views

Efficiently using Apache HttpClient in multithreaded environment

I have a library which is being used by customers and they are passing DataRequest object which has userid, various ...
10
votes
3answers
2k views

Imgur URL parser

Fairly new to Python, and I have been doing a few Edabit challenges, to better help with my problem-solving. I have just completed a some what semi-difficult challenge, and I was hoping for some feed ...
10
votes
2answers
607 views

Taking YouTube links out of a list of GitHub repo READMEs

I have a .csv file that contains student GitHub repository assignment submissions. I made a script to go to each repository and extract the YouTube video that they must have provided in their README ...
10
votes
1answer
1k views

Read and replace URL from PDF file

This is a code I wrote to find all URL within a PDF file and replace the one that matches the ID that I passed as a parameter. It works as intended, but as I am a beginner on Java, I am sure there ...
9
votes
5answers
12k views

Appending a trailing slash if needed

I like to overcomplicate things, this is fairly simple though but I would like to keep it simpler without lowering readability. Not just to improve my code but also my self. ...
9
votes
2answers
15k views

Truncate port number from absolute Uri

We had a requirement to remove the port number from the Request.Url.AbsoluteUr i.e Actual: https://mysitename:443/Home/Index ...
9
votes
2answers
6k views

URLify a string using Python

I have been working my way through the exercises in the book Cracking the Coding Interview. I wanted to get feedback for the following exercise. Write a method to replace all spaces in a string ...
9
votes
4answers
22k views

Splitting URL query string to key-value pairs

I have a URL query string "key={value}&key2={value2}&key3={value3}" and have to produce a key-value pair of the string by splitting ...
9
votes
2answers
857 views

Serializing JSON data coming from two URLs in the same object

I have two URLs (urlA and urlB) and both the URL gives me a JSON response back in the same JSON format. Below is my JSON string ...
8
votes
5answers
740 views

Checking URL validity

This is sort of a follow up to a previous question (Do I have any SQL leaks?). I have changed some things around and am working on a solution where I use Active Directory to gather information about ...
8
votes
5answers
4k views

Selecting checkboxes based on URL parameters

Is there any way to reduce these lines of code? ...
8
votes
3answers
689 views

Function for getting URLs

This is a simple Python program I wrote. I hope some one could help me optimize this program. If you found any bad habits, please tell me. ...
8
votes
2answers
8k views

What do you think of my regex for URL validation?

I would like you to review my regex. It's suppose to recognize common URLs like: ...
8
votes
3answers
2k views

Tiny URL creator

Coding challenge: Convert a given long URL into a Tiny URL. The length of this Tiny URL should be fixed and the same for all URLs. You should return the full URL if given a shortened URL. I am ...
8
votes
2answers
2k views

Extracting the last component (basename) of a filesystem path

...
8
votes
2answers
107 views

Opening all the links

I am looking to improve my code structure. In this code it is opening all the links with ?pid= in the url. However, the structure of the code can be improved. <...
7
votes
5answers
7k views

How can I better my URL checker program?

I made a LinkChecker program which checks URLs from a text file and outputs status into another file like this: ...
7
votes
2answers
3k views

Efficient URL Escape (Percent-Encoding)

Here I have a simple algorithm to percent-encode any string. (Specification from Wikipedia; note that this is not compatible with URLEncoder.encode()) Is this an ...
7
votes
4answers
224 views

Cleaner or better readability in URL composition

I have a URL that is hardcoded via a config which I extract into a config: ...
7
votes
1answer
92 views

Getting a value from a query string

I have a URL in this format: http://localhost:57279/AssociateCaseDetails?UId=176948&caseID=1123 I need the values of UId ...
7
votes
2answers
4k views

Custom Authentication Attribute

I was trying to find a way to redirect to different pages on authorization and authentication failure. I found this to be a possible solution. However, I ended with a different solution by myself. It ...
7
votes
1answer
5k views

Download a file from given URL and retry on connection errors

I wrote a script for Python 2.78 which is supposed to download and save a file from a given URL using the requests library. In case that a connection to the server can be established and a valid ...
7
votes
1answer
2k views

Parsing URLs in Pandas DataFrame

My client needs their Google AdWords destination URL query parsed and the values spell checked to eliminate any typos ("use" instead of "us", etc). I'm pulling the data using the AdWords API and ...
7
votes
1answer
273 views

Canonicalize URLs for static website

I want to "canonicalize" URLs for my static (files and folders) website. The 'Aims' describes what I want to accomplish. The 'Code' gives my current .htaccess. ...
7
votes
2answers
3k views

URL-safe pseudorandom string generator in C#

...
6
votes
3answers
317 views

Dynamically loading CSS files based on URL or URI in PHP

I have written out the following code in the head section of my document, which should load 3 separate style sheets for each page based on the URL/URI that the user is visiting. It is working as ...
6
votes
2answers
2k views

Parallel “wget” in Java

Purpose: write Java program that downloads a list of URLs specified on commandline in parallel (simultaneously), reporting download completion every second. My solution follows below, please point ...
6
votes
2answers
2k views

C# helper class - mailto

I'm looking for input, advice, criticism. This is my first helper class. While use of mailto URLs should most often be trivial, I have a real world need to send to multiple recipients and with a body ...
6
votes
3answers
252 views

Extending window.location give access to query string elements

I am attempting to add a property to access the query string elements on the window and am looking for feedback on this implementation. ...
6
votes
2answers
1k views

Simple python script to shorten URLs in specified text files

A recent question inspired me to write a script for this task: Shorten URLs in specified text files using googleapis.com Handle multiple URLs, whether on the same line or multiple lines The original ...
6
votes
4answers
10k views

Getting country based on IP

I'm using Struts2 and Google App Engine. Below is my program for getting the country based on the IP of the visitor of the website. In my Struts2 action: ...
6
votes
2answers
70 views

Refactor module for calls to internal image service

Looking for help refactoring the following code to follow a Functional Programming paradigm. The first function builds a configuration object with default settings and optional presets, while the <...
6
votes
4answers
63k views

Remove a parameter and its value from URL's query string

I'm coding an algorithm to remove a parameter (let's call it foo) from URL strings. Of course, after the foo parameter removal, ...
6
votes
2answers
103 views

Extracting information from a URI

I'm completely new to C and my first project is to create a simple cURL-like HTTP request client... but first, I need to create a function that can parse a URL. I've created this function, and it ...
6
votes
3answers
2k views

Regex to parse URLs for their correctness according to RFC 3986

I recently came to write a regex to parse URLs. Now I wonder, did I miss something? Did I make a mistake or could I have written it cleaner? That's why I'm here. In order to write the regex, I took ...
6
votes
1answer
546 views

Git commit-msg URL shortener

I have just written my first git hook script. It is very simple that simply finds any URLs in the commit message and uses the Google URL shortener to rewrite the URL nicely. it is located here. I ...
6
votes
1answer
474 views

Creating URL with Builder pattern

What do you think about this piece of code? How would you design the builder pattern in this situation? ...
6
votes
2answers
1k views

Routing for a Laravel 5 e-commerce site

I am new here and learning Laravel 5 on my own. I want to get reviewed on the following routes.php code. My question are: Have I made any mistakes by doing this? If yes, then what could be the ...
6
votes
2answers
1k views

Checking for existence of URL parameters

I'm busy rewriting some from my spaghetti code into OOP classes. I'm still learning OOP and very new to the concept. From help from this answer from @EliasVanOotegemto on a previous question I've ...
6
votes
1answer
188 views

Image-downloader/wallpaper setter

I'm making an image-downloading app that sets the image as the device wallpaper. For this I used the class: ImageDownloader.java This class has a function which ...
6
votes
2answers
114 views

Django controller method to list the top characters, guilds, and killers

I've been reading the Chapter 8 of this book. Here's the view I'm currently coding. It list all characters/guilds according to the type of URL. ...
6
votes
1answer
512 views

Expanding url from shortened url obtained from tweet

I have a twitter data set. I have extracted all the expanded urls from the json and now am trying to resolve the shortened ones. Also, I need to check which urls are still working and only keep those. ...
5
votes
3answers
7k views

Searching for a string in a downloaded PDF

This code goes to the website containing the PDF, downloads the PDF, then it converts this PDF to text. Finally, it reads this whole file (Over 5000 lines) into a list, line by line, and searches for ...
5
votes
2answers
28k views

Hiding $_GET variables using encryption

I use the following functions to encrypt my $_GET variables (whenever I can't easily get away with using $_POST or some other ...

1
2 3 4 5