Last active
July 9, 2018 04:38
-
-
Save acid-chicken/ec1540434641108ce7425950b73af54a to your computer and use it in GitHub Desktop.
Misskey for Argos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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