Skip to content

Instantly share code, notes, and snippets.

@acid-chicken
Last active July 9, 2018 04:38
Show Gist options
  • Save acid-chicken/ec1540434641108ce7425950b73af54a to your computer and use it in GitHub Desktop.
Save acid-chicken/ec1540434641108ce7425950b73af54a to your computer and use it in GitHub Desktop.
Misskey for Argos
#!/usr/bin/env bash
# Misskey for [Argos](https://github.com/p-e-w/argos)
misskey_token='> MISSKEY TOKEN GOES HERE <'
echo 'Misskey'
echo '---'
echo '再読込 | iconName=gtk-refresh refresh=true'
curl -s -w '\n' -X POST -d '{"limit":100}' -- "https://misskey.xyz/api/notes/local-timeline?i=$misskey_token" | jq -r '.[] | select(.text != null) | [ .id, .user.avatarUrl, .text ] | reduce .[1:][] as $i ("__argos_startline__\(.[0])"; . + " \($i)" )' | sed -e ':a;N;$!ba;s/\n//g;s/__argos_startline__//;s/__argos_startline__/\n/g' | head -n 20 | while read line
do
array=($line)
echo `echo ${array[@]:2:${#array[*]}} | sed 's/__argos_space__/ /g;s/|/|/g' | mofucut 0 79`" | image='`curl -s ${array[1]} | base64 -w 0`' imageWidth=16 href='https://misskey.xyz/notes/${array[0]}'"
done
import system, os, strutils, unicode
if isMainModule and paramCount() == 2:
let begin = os.commandLineParams()[0]
let finish = os.commandLineParams()[1]
echo runeSubStr(readLine stdin, if begin == "199000万": 1990000000 else: parseInt begin, if finish == "199000万": 1990000000 else: parseInt finish)
else:
stderr.writeLine "Usage: mofucut STARTPOS ENDPOS"
system.programResult = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment