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
4
votes
3answers
94 views

A Swiss Army like module for dealing with HTTP and URLs

I code a lot of web crawlers and web scrapers and I find myself writing the same functions over and over again. I also find myself having to come to Stack Overflow and find the answer to a question I ...
4
votes
0answers
610 views

Generating Bitly links in a Google Sheet

I have this set of functions in my Google Sheet to create a Bitly bitlink whenever data in a row is changed. While this does work, it seems really slow to me. Looking at the Execution transcript, it ...
5
votes
1answer
109 views

Selecting site to browse in python

This code is for part of my first major contribution to open-source, for the socli project. The purpose is to allow the user to select a site from the stack exchange network to browse and fill two ...
4
votes
1answer
55 views

Web app that splits a URL graphically

I wrote this web app that splits a URL graphically so that its parts can be customized to create a new URL. https://github.com/ibrahim-islam/urlpad. The app currently works as expected for usual URls ...
2
votes
1answer
351 views

URL whitelist class

I'm trying to make a class for safe redirection of URLs. Redirecting URLs is something you can have in a get parameter, for example: ...
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. ...
4
votes
2answers
910 views

Filter out URLs with any of some given file extensions

I wrote some code to filter a list of links, URLs, with multiple conditions given by file extensions. I want to remove every URL that is not an HTML file. The code is: ...
1
vote
0answers
210 views

Parsing URL query strings in AngularJS

Here are two very small blocks of code I wrote while trying to fix a bug in AngularJS. Both do the same thing. I'm trying to understand how the two differ, mainly in terms of the tradeoff between cpu ...
4
votes
1answer
205 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)? ...
1
vote
1answer
788 views

Php class for url generator

I wrote a class to generate URL as I need. (Using http or https and switching off the rewrite rules) That is my first OOP code. It's the right approach, any suggestion? inc/class.urls.inc.php ...
2
votes
1answer
686 views

Remove a query string parameter from a URL

I have a URL in wstring format in C++, e.g.: http://stackoverflow.com?Country=US&City=Seattle&State=WA I want to get rid of Country query param from the ...
6
votes
1answer
479 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. ...
10
votes
2answers
604 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 ...
5
votes
2answers
2k views

C++ Query String Parser

This query string parser is intended to parse the parameters and values of a parser query string. I'm particularly concerned about my use of std::move(...). I ...
5
votes
2answers
238 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: ...
4
votes
3answers
69 views

Getting the Twitter account from various input formats

I have an input for users to enter a Twitter account in any different way and I want to extract the user account. For example: ...
1
vote
0answers
768 views

Parse query filter expression from request URL

I am building a backend APi for which I need to extract query filters from request URL of following pattern: ...
3
votes
1answer
130 views

T-SQL UDF to replace replace base URLs

I have a problem where I need to replace every base part of URLs in a body of text. However, I only want to replace it in specific URLs. Only URLs that go to "resource.aspx" that have the "source" ...
0
votes
2answers
810 views

PHP script to generate hreflang tags

I'm currently working on a website which provides content to users based on their region. As a result the website has subdirectories for the appropriate regions. For example, a pricing page would look ...
3
votes
1answer
96 views

Summarizing and crawling the content of a URL

Lately I've been working on a practice project using JS ES6 to understand it better, therefore I've read a lot about JS design patterns and JS coding strategy. My question is about splitting the ...
1
vote
2answers
3k views

Returning a URL string of an API endpoint

I have a class with multiple methods which return a URL string of an API endpoint. Each method takes different parameters based on what the endpoint have to include. Examples (among others): GET: <...
1
vote
2answers
63 views

Functional method for storing a query string as a simple key-value object

I'm working on an isomorphic javascript module (query-hash) to handle query strings and base64 tokens. It's essentially a simple key-value object with methods for taking in data and giving it back in ...
3
votes
3answers
371 views

URLIfy a character array using Python - follow-up

This is a follow up to my last code review: URLify a string using Python This problem has been reviewed in other languages, but I tried to solve this without looking at those answers. I am hoping ...
9
votes
2answers
5k 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
5answers
9k 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. ...
0
votes
1answer
794 views

Return the last word of the url and capitalize the first letter

Can the below code be done in one line? Do you think it should or is it ok like this? ...
0
votes
2answers
780 views

Exception handling in URL builder method

I have a method which is part of a request-handling class. It creates a URL, depending on the resource send request. This is a part of the REST service: ...
-1
votes
2answers
70 views

Initiating some activities depending on the presence of certain URL parameters

What is the best way to refactor this long if else statements? make it shorter and more readable code. I thought to use sub-classes but I don't understand how to implement that, so examples will be ...
4
votes
2answers
33 views

Isolate URLs from other text around it and put each on own line (with sed)

I have a small shell script that uses sed to take an input file of URLs with hand-written notes around them and strips the notes and puts each URL on its own line. ...
5
votes
2answers
687 views

Express middleware to validate URL and tags

I am building an API where the client can send a url and some comma-delimited tags: ...
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. ...
2
votes
1answer
59 views

IsImageUrl extension method written in F#

I'm a newbie to F# and so I've written a small extension method library to practice the language. The extension method attempts to determine if a url string is for an image. I wrote the code as an ...
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 ...
11
votes
2answers
7k 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 ...
3
votes
1answer
84 views

Determine base URL of PHP app

I have this little piece of code which determines the base URL of PHP: ...
0
votes
1answer
43 views

Loading URLs via a case statement

I have the following code which loads in a URL based on the id of a user-clicked button. I'm looking to compress it down as much as possible, and make it more modular and reusable: ...
-1
votes
1answer
49 views

Skipping Google search results that point to certain sites

I have the following code that will skip certain URLs if needed: ...
2
votes
1answer
2k views

Javascript RegEx match URLs for tokens extraction

Given a URL like this: ...
1
vote
2answers
83 views

Recreating a URL string

This is what my viewObject looks like: ...
3
votes
1answer
133 views

Parsing URL query and appending it at end of the other URL

I am trying to grab the URL query of the URL which is in the browser's address bar, then append it at the end of the other URL and echo it to the browser. So, if I visit my script at: http://...
2
votes
1answer
68 views

Building a SharePoint Search URL

I'm trying to build a URL to call the SharePoint Search REST API in TypeScript. The interesting part is building the querytext, which is done by my buildQueryText method. In my case it takes two ...
1
vote
0answers
806 views

URL validation and data extraction

What do you think about this approach to validate and analyze URLs? There are Url and Url<TResource> model types to ...
4
votes
1answer
313 views

Extracting various URL parameters in Rest Service and then passing it to Builder class

I have a service which takes a lot of key value parameters in a URL. Only a few are mandatory and others are optional. It's up to the customer whether they want to set those optional parameters or not....
2
votes
2answers
1k views

Parsing “mailto:”

Can you help me to review my "mailto:"-parsing function ? Since I'm trying to write less code, that is as simple as possible. I'm not sure there if there is some bug or better solution. ...
1
vote
1answer
105 views

Converting url data to base 64

I've a piece of code down below that I'm really unsure about. Basically an user can type the url (urlStr param of the method) he wants. From this url I need to : get the data as Base64 so I can ...
5
votes
1answer
463 views

Router to match URL to Controller Method

I wrote a router class which accepts a URL and calls the appropriate controller method based on it. I'm a little worried about the amount of dependencies it has (eg ...
2
votes
2answers
637 views

str_replace vs array_map & trim on URL segments

Are there any advantages on using array_map & trim vs using simple str_replace? The ...
3
votes
1answer
395 views

Construct a URL given an Enum

I have a below code which constructs the URL given a FlowType enum. ...
4
votes
3answers
597 views

Generating a URL

I have a function that generates a URL using a stringbuilder: ...
3
votes
1answer
279 views

Downloading HTML documents from the web

In this project I'm working on, I need to extract articles text from their original HTML document. This class, HtmlConnection, receives the URL of the article, and ...