Yourls: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
Line 104: Line 104:
|valign='top' style='width:34%'|
|valign='top' style='width:34%'|
* [[Convention for Database Tables|Convention » Database » Table]]
* [[Convention for Database Tables|Convention » Database » Table]]
* [[Convention for API|Convention » API]]


|valign='top' style='width:33%'|
|valign='top' style='width:33%'|


|}
|}

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