Skip to main content

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
3 votes
2 answers
209 views

the helper fuctions for a url shortener

Currently I am still considering of using the get_password instead of the token_urlsafe but not sure yet. The shortener will be ...
K Y's user avatar
  • 185
3 votes
1 answer
180 views

Detect the social network of a given URL

I am making a class in PHP that detects the social network or instant messaging platform of a given URL: ...
Dimitrios Desyllas's user avatar
4 votes
1 answer
100 views

Java classes for downloading all in-coming/out-going links of an article in the Wikipedia article graph

(The entire project is in GitHub.) Introduction This project provides facilities for generating in-coming or out-going links in a given Wikipedia page. Code ...
coderodde's user avatar
  • 29.1k
1 vote
1 answer
85 views

State machine for parsing GitHub URL formats

A while ago, I wrote a small Rust crate for parsing & generating URLs for GitHub repositories in various formats (HTTPS, SSH, git://, etc.), with the parsing done using regular expressions with ...
jwodder's user avatar
  • 402
7 votes
1 answer
175 views

Download artifacts using HTTP

The public code is SaveAsFile(). It takes a URL, checksum and authentication info, and downloads the artifact and its hash using HTTP. It saves the content as a ...
Alberto's user avatar
  • 173
2 votes
0 answers
200 views

Parallelized Web Crawler

Exercise is here: https://go.dev/tour/concurrency/10 Prompt: In this exercise you'll use Go's concurrency features to parallelize a web crawler. Modify the Crawl function to fetch URLs in parallel ...
CageFury's user avatar
-4 votes
1 answer
130 views

Test all links in a website

This program tests all links (URLs) in all pages of a website. Testing a link (URL) means that the link (URL) is downloaded. If the download is successful then a success message is printed for that ...
user avatar
2 votes
0 answers
588 views

Convert PathBuf to file URL in Rust

I've implemented a custom trait on std::path::Path (and by extension std::path::PathBuf) with a method which turns the struct ...
Jared Smith's user avatar
1 vote
1 answer
3k views

Regex detect URL without http(s):// and www

I want to locate urls without protocols in the text, and then add the protocol before them. This means I don't want urls that begin with http(s):// or ...
tnthpp66's user avatar
2 votes
0 answers
663 views

Generate breadcrumbs from URL in Django

For Django sites with URLs structured in a hierarchical way I found it helpful to have an app to quickly transform an URL like ...
marcanuy's user avatar
  • 305
3 votes
2 answers
7k views

Function for checking if a string is a path or an URL be improved

I made myself a function to check if a string is a path or an URL: ...
TheEagle's user avatar
  • 133
6 votes
1 answer
92 views

How can this async url response checker be cleaner/faster?

...
humid's user avatar
  • 101
4 votes
1 answer
1k 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 ...
mateass's user avatar
  • 41
2 votes
0 answers
40 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 ...
charmoniumQ's user avatar
3 votes
0 answers
82 views

Asynchronously extract title from URLs using Python

The following code asynchronously extract title from URLs (saved in book-urls.txt). ...
Ahmad Ismail's user avatar
2 votes
1 answer
54 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. I ...
bizimetal's user avatar
-1 votes
2 answers
126 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: ...
Kate Velasquez's user avatar
3 votes
1 answer
180 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 ...
aki's user avatar
  • 824
3 votes
1 answer
2k 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. ...
Rasela Don's user avatar
1 vote
1 answer
3k 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 ...
dengApro's user avatar
  • 381
4 votes
1 answer
62 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 ...
JJJohn's user avatar
  • 199
4 votes
1 answer
70 views

Function to create URL relative to a configured base URL

I have written this function to create a URL: ...
abhinav's user avatar
  • 151
5 votes
1 answer
151 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. ...
Jack Tyler's user avatar
8 votes
3 answers
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 ...
MrJoe's user avatar
  • 2,053
4 votes
1 answer
198 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 ...
Kaloian Kozlev's user avatar
6 votes
4 answers
2k 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 ...
Ryan Stone's user avatar
1 vote
1 answer
191 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 ...
Manjeet Thakur's user avatar
1 vote
1 answer
30 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. ...
pipilam's user avatar
  • 183
0 votes
2 answers
76 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? ...
XelaNimed's user avatar
  • 103
2 votes
0 answers
59 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 ...
Suryasis Paul's user avatar
1 vote
2 answers
820 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, ...
Josh Hallow's user avatar
  • 1,375
4 votes
3 answers
3k 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 ...
wispi's user avatar
  • 185
3 votes
1 answer
148 views

Userscript to redirect insecure pages to HTTPS

I am developing a userscript that redirects insecure pages (HTTP) to the https: version. ...
alphabetadev's user avatar
10 votes
3 answers
3k 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 ...
tightasbzip's user avatar
2 votes
1 answer
152 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 ...
Kaloian Kozlev's user avatar
4 votes
2 answers
1k 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 ...
hrp8sfH4xQ4's user avatar
1 vote
3 answers
91 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 ...
confusedGibbon's user avatar
0 votes
1 answer
187 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: ...
NewSites's user avatar
  • 125
2 votes
1 answer
181 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. ...
xkeshav's user avatar
  • 121
6 votes
3 answers
296 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. ...
Adam H's user avatar
  • 218
5 votes
1 answer
844 views

Splitting URLs into hierarchy-level directories

The goal is to split a URL like http://q.com/a/b/c to: ['http://q.com/a', 'http://q.com/a/b', 'http://q.com/a/b/c'] My code: ...
UnderpoweredNinja's user avatar
3 votes
2 answers
494 views

Parse a clean slug URL

I have to implement a "user-friendly" URL for an employment website. The URL /jobs{parameters?} may be composed of up to three searching criteria separated by ...
Razor's user avatar
  • 89
6 votes
1 answer
2k 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? ...
nullbyte's user avatar
  • 415
5 votes
1 answer
1k views

Simple URL shortener

This URL shortener is just for my own use and it runs on my local machine. I created this for fun and I doubt if I would ever use it in production. Is my script any good? shortener.php ...
Zylvan's user avatar
  • 53
3 votes
3 answers
2k views

Creating and parsing query strings

In a moment of boredom, I decided to write two methods, one of which would create a query string, while the other would parse it, the constraint I imposed on myself being that each method could not ...
Happy Koala's user avatar
0 votes
2 answers
1k views

XSS Protection from Query Strings in Java

Looking for input on the code below. Generally, the idea is to take a String representing a URL query string such as param1=blah&param2=blah and encode them to ...
Jason's user avatar
  • 385
4 votes
1 answer
1k 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 ...
Juan's user avatar
  • 655
2 votes
2 answers
1k views

Sorting elements in array with a certain condition

This is what I have: function get_create returns a link with new filtered/sorted properties: Code on screenshot ...
Medion's user avatar
  • 23
3 votes
4 answers
181 views

Query URL parameters in downloading pictures from network cameras

I have some URLs saved in my database, to download pictures from network cameras. Because each camera has it's own URL and parameters, we have to store the entire URL in a field in the database. My ...
Zorkind's user avatar
  • 131
7 votes
2 answers
4k views

URL-safe pseudorandom string generator in C#

...
Christian Wattengård's user avatar

1
2 3 4 5