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
5
votes
1answer
3k views

Presenting long string literals (URLs) in Python

I have a web scraping application that contains long string literals for the URLs. What would be the best way to present them (keeping in mind that I would like to adhere to PEP-8. ...
5
votes
1answer
70 views
5
votes
1answer
63 views

URL parser in C

Title should be self-explenatory. This is a simple URL parser I wrote in C. The function takes a URL from the user and produces a struct that contains the information that can be used to request the ...
2
votes
0answers
32 views

Abstraction to make URLs (many different schemes) act like Paths on disk

The config file for my project takes many files and directories. It would be convenient if these files and directories could reference git repositories, zip archives, possibly over https. This ...
3
votes
0answers
62 views

Asynchronously extract title from URLs using Python

The following code asynchronously extract title from URLs (saved in book-urls.txt). ...
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
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
2answers
3k views
2
votes
1answer
39 views

Refactoring string incrementing and duplicating function

I wrote this script and got what I wanted from it. However I'm looking for input on ways I can improve the function. My goal was to scrape a bunch of image links from a website I'd like to rebuild. ...
-1
votes
2answers
113 views

Collect a list of unique “Origin” headers from a repeated URL request [closed]

I want to create a list of the different response headers I get when querying an URL, I succeeded in doing this this way: ...
9
votes
5answers
13k 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. ...
3
votes
1answer
100 views

Resolve alias' original item using bookmarkData

This is my first Objective-C++ code, so I'm a bit lacking in the knowledge of methods. I need to resolve a macOS alias and get its original location. I have access to the C string, which is the file ...
5
votes
2answers
254 views

URL decode a string but log an error after second exception

I have a method which does URL decoding on the string value passed along with using Charset: ...
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 ...
2
votes
1answer
393 views

Function to convert a title to a slug

I'm creating a function that converts a title, to a URL slug. I'm not all to familiar with regular expressions, but I've done my best. Can you see any problems or improvements with the following ...
3
votes
1answer
781 views

Validate URL with Regex and java.net.URL

I'm writing a URL validator. Firstly, it checks for special characters in the input. Secondly, it adds 'http://' and checks for validity. ...
1
vote
1answer
564 views

Swift: extract string with regex and range

In Swift, I have a string like this http://mnc-hdqp.oss-cn-shanghai.aliyuncs.com/user%2Fheat%2Fdefault.jpg?Signature=2BI%2BauSvy&Expires=1568682491&OSSAccessKeyId=LTAIQ8Lif1HHVkXd Need to ...
5
votes
1answer
99 views

Download and concatenate text files from multiple API endpoints

Background Chronicling America is an archive of digitized US newspapers hosted by the Library of Congress. The site allows programmatic access of its resources through an API, one part of which is ...
3
votes
1answer
54 views

A tiny util to converts an SO URL to revised version

I am trying to write a util that converts an SO URL to revised version, for example, given this url: 'https://stackoverflow.com/q/57449318/10731613' this util ...
1
vote
0answers
49 views

How to filter URL from the array list based on the string name with regExp?

The solution found to filtering pathname with customising current normalizeTme() function. For sure it is not the ideal way of ...
4
votes
1answer
52 views

Function to create URL relative to a configured base URL

I have written this function to create a URL: ...
0
votes
0answers
28 views
5
votes
3answers
220 views

Issue a redirect, trying several string replacements for the domain

How could I improve this code? ...
4
votes
1answer
114 views

URL builder in Python

I created a code that will create, or rather build a URL based on the configuration. Everything works, however with the expansion of my project I added multiple languages etc. every section only ...
5
votes
1answer
127 views

Detecting the presence of multiple URL segments

I have two versions of a function that performs the same task, however I'm not sure which one to use. Speed is something to take into consideration, but I also want to know what the best practice is. ...
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 ...
6
votes
3answers
365 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 ...
1
vote
1answer
88 views

Convert query string into object in JavaScript

Suppose I have this query and want to convert into an object a1.b2.article1=0&a2.article2=1&c3!article3=0&article16-abc=2 output for this should be ...
1
vote
1answer
27 views

Summing buying and selling rate fetched from the web txt

I've got a class that is like a facade, like an engine for my application which is responsible for fetching data from url and summing it. I have got problem with proper names for my methods. ...
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 ...
0
votes
1answer
84 views

Manipulating URL/array to remove the last element

Is there a better way to do this using chaining? ...
0
votes
2answers
45 views

The function to convert an object to a URL string

There is a function to convert object to the GET parameters for the ASP.Net controller. Is it possible to minimize the redundancy of the code, but not to the detriment of its readability? ...
4
votes
1answer
522 views

URL pattern matching for request blocking

I'm trying to write a URL pattern matching utility that, given a pattern and a URL it'll tell whether the URL matches the pattern or not. I want to use this for users to provide a list of URL patterns ...
2
votes
0answers
48 views

Database code for Python-based URL shortener

I had implemented a URL shortener with Python and a database. Please review the database part of the code. The idea is to create an MD5 hash of the URL in question and then store it in a database. The ...
1
vote
2answers
554 views

Simple router in PHP

Before I start writing my first MVC framework, I want to improve my code quality as much as I can, can anyone give me some constructive criticism on how I can improve this? It is a simple router, ...
3
votes
3answers
794 views

Parse a GET or POST string in C

This function takes a string from an HTTP POST or GET string, finds the specified variable, and allocates memory for the result and puts it in a string. The destination is given as an address of an ...
4
votes
2answers
116 views

Sign an EC2/S3 URL Version 3

From the previous 2 versions: Sign an EC2/S3 URL Version 2 I fixed the comments from the previous version. Most of the code remains the same (so I have split out the new code for review). The main ...
4
votes
1answer
224 views

Raw replacement of space by %20 in Java

I tried coding this for practice. Is there a more memory-efficient way to work in place without using more arrays etc (using raw array operations)? ...
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, ...
3
votes
1answer
71 views

Userscript to redirect insecure pages to HTTPS

I am developing a userscript that redirects insecure pages (HTTP) to the https: version. ...
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 ...
3
votes
1answer
133 views

Function to get URL

This is a function I wrote which has the intention of extracting bits of the URL. For the latest version visit my GitHub. ...
1
vote
0answers
19 views

Differ returned web link from app scheme

I have a WebView, which loads the returned from a request url. The thing is, the url might ...
2
votes
1answer
74 views

Generate URLs based on user's menu choices

My program generates URLs. It takes in 3 variables and substitutes them in a URL to create different working URLs. It also has 3 options for language selection, which change the language of the page ...
0
votes
1answer
147 views

Object for generating HTML for hyperlinks

I have a function that generates HTML for hyperlinks. It's arguments may be string literals or variables read from the database. An example call to this function looks like: ...
4
votes
2answers
122 views

Split URL into segments

I try to split URLs into segments. These segments got two information, their name and their own URL. The last segment in the segments list should not have the URL property because it's the current ...
1
vote
3answers
76 views

Always keep https in url

I wrote this recently, I thought I'd check if it was the best way to keep my url as an https at all times, any advice would be appreciated ...
2
votes
1answer
94 views

Building query params which append to URL in a browser

I was looking for a similar JavaScript method for http_build_query but did not find but create my own and here I am a bit confused to decide the right approach. ...

1
2 3 4 5