LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   any url shortener allows immediate request parameters? (https://www.linuxquestions.org/questions/general-10/any-url-shortener-allows-immediate-request-parameters-4175736471/)

Michael Uplawski 04-27-2024 03:48 AM

any url shortener allows immediate request parameters?
 
Good morning

Do you know of an url shortener service online that still reacts to a full request, like with wget or curl, complete with parameters (in april 2024, that is)?

The examples I find on the Web are outdated, my tests have shown that this does not work any more with most of the services used a while ago.

So, if I am interpreting this correctly, you have to access via the start page and fill out a form, each time. I am installing the Rust urlshortener for cli and am at “Updating crates.io index” for half an hour.

Now it downloads tons of dependencies, while all that I wanted was parse some HTML.

:(

Edit: I can write a Selenium- or Watir Webdriver bot. The problem is that I want to *recommend* something to others. I can skip the whole topic, too, if need be.
Edit II: (off-topic) The Watir Web-Site at https://www.watir.com is down, but the content is copied to https://watir.github.io/. For those who want to know.

TIA

Michael Uplawski 04-27-2024 04:25 AM

So upon testing urlshortener-cli with some arbitrary URL like
Code:

urlshortener-cli https://www.linuxquestions.org/questions/lqsearch.php?do=getnew&daysprune=7
I notice that they used the url-shortener at <https://is.gd>.

Now guess.
Code:

curl "https://is.gd/create.php?format=simple&url=https://www.linuxquestions.org/questions/lqsearch.php?do=getnew&daysprune=7"
https://is.gd/zXL7fq

Here is my list of useable url-shorteners.
  1. is.gd

The services used by the urlshorteher-rs library are in their Readme: https://github.com/iddm/urlshortener-rs

But the domains are not all valid and at least for the last one (biturl.com), I cannot find out how to use it with curl.

Anyway: apt remove cargo; rm -rf ~/.cargo

Michael Uplawski 04-27-2024 04:07 PM

3 Attachment(s)
URL shortener for the desktop. Needs YAD:

Code:

#!/bin/bash
icon='your_url_icon'
title='shorten URL'
text='URL'
# the part of the request-string which precedes the url to shorten
service='https://is.gd/create.php?format=simple&url='

url=$(yad --image="$icon" --window-icon="$icon" --title="$title" --form --field="$text")
if [ "$?" == 0 ]
then
  url=`echo $url | tr -d '|'`
  echo "|$url|"
  if [ "$url" != '' ]
  then
        su=`curl "$service$url"`

        echo "$su" | yad --undecorated --on-top --image "dialog-info" --window-icon="$icon" --title "Result" --selectable-labels --text="$su"
  else
        yad --on-top --undecorated --image "dialog-warning" --window-icon="$icon" --title "INPUT EMPTY" --text="No url given!"
        exit
  fi
else
  exit
fi

Screen shots (German locale, “Cancel” = „Abbrechen”): dialog, dialog with URL, result


All times are GMT -5. The time now is 10:44 PM.