Yourls: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==Yourls » PHP==
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left'|
Helm » Debug
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='php'>
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = md5( $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&action=shorturl&format=json&url=https://google.com";
PHP
</syntaxhighlight>
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='php'>
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = hash( 'sha256' , $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&hash=sha256&action=shorturl&format=json&url=https://google.com";
PHP
</syntaxhighlight>
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='php'>
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = hash( 'sha512' , $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&hash=sha512&action=shorturl&format=json&url=https://google.com";
PHP
</syntaxhighlight>
|}
==Yourls » Bash==
==Yourls » Bash==
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'

Revision as of 02:59, 27 December 2025

Yourls » PHP

Helm » Debug

echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = md5( $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&action=shorturl&format=json&url=https://google.com";
PHP
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = hash( 'sha256' , $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&hash=sha256&action=shorturl&format=json&url=https://google.com";
PHP
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -sSL | jq -r .shorturl
<?php
$timestamp = time();
$signature = hash( 'sha512' , $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&timestamp={$timestamp}&hash=sha512&action=shorturl&format=json&url=https://google.com";
PHP

Yourls » Bash

Helm » Debug

echo; \
cat <<'EXE' | bash
TOKEN='1002a612b4'
TIMESTAMP="$(date +%s)"
TARGET_URL='https://google.com'
YOURLS_URL='https://go.shahed.biz.ops/yourls-api.php'
SIGNATURE="$(printf '%s%s' "${TIMESTAMP}" "${TOKEN}" | md5sum | awk '{print $1}')"
curl -sSL "${YOURLS_URL}?signature=${SIGNATURE}&timestamp=${TIMESTAMP}&action=shorturl&format=json&url=${TARGET_URL}" | jq -r .shorturl
EXE
echo; \
cat <<'EXE' | bash
TOKEN='1002a612b4'
TIMESTAMP="$(date +%s)"
TARGET_URL='https://google.com'
YOURLS_URL='https://go.shahed.biz.ops/yourls-api.php'
SIGNATURE="$(printf '%s%s' "${TIMESTAMP}" "${TOKEN}" | shasum -a 256 | awk '{print $1}')"
curl -sSL "${YOURLS_URL}?signature=${SIGNATURE}&timestamp=${TIMESTAMP}&hash=sha256&action=shorturl&format=json&url=${TARGET_URL}" | jq -r .shorturl
EXE
echo; \
cat <<'EXE' | bash
TOKEN='1002a612b4'
TIMESTAMP="$(date +%s)"
TARGET_URL='https://google.com'
YOURLS_URL='https://go.shahed.biz.ops/yourls-api.php'
SIGNATURE="$(printf '%s%s' "${TIMESTAMP}" "${TOKEN}" | shasum -a 512 | awk '{print $1}')"
curl -sSL "${YOURLS_URL}?signature=${SIGNATURE}&timestamp=${TIMESTAMP}&hash=sha512&action=shorturl&format=json&url=${TARGET_URL}" | jq -r .shorturl
EXE

References

References