aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-02-26 13:05:48 -0700
committernytpu <alex@nytpu.com>2021-02-26 13:05:48 -0700
commit86a818f726a519e9d738a3e6a77919c0a43fb7a9 (patch)
tree9326ec279892e12a936cd26d6a50ace9fc5689a1
parentimprove line skipping when generating index (diff)
downloadcheetah-bot-86a818f726a519e9d738a3e6a77919c0a43fb7a9.tar.bz2
cheetah-bot-86a818f726a519e9d738a3e6a77919c0a43fb7a9.zip
update header on page
-rw-r--r--cheetah-bot.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/cheetah-bot.go b/cheetah-bot.go
index 136e160..03f1914 100644
--- a/cheetah-bot.go
+++ b/cheetah-bot.go
@@ -9,6 +9,7 @@ import (
"io/ioutil"
"os"
"time"
+
/*
// imgur stuff
"github.com/koffeinsource/go-imgur"
@@ -102,7 +103,16 @@ func main() {
titleMasto := fmt.Sprintf("Day %d: %s\n#cheetah\n", day, description)
curYear, curMonth, curDay := time.Now().Date()
- titleGemini := "# Cheetah a Day\n\n"
+ titleGemini := `# Cheetah a Day
+
+Cheetahs are the best animals, and I'm here to share them with you. Be sure to subscribe with your favorite gemini feed aggregator!
+
+=> https://botsin.space/@cheetah_a_day Mirrored on the Fediverse, see @cheetah_a_day@botsin.space
+=> https://old.reddit.com/r/Cheetahs/ Also mirrored on reddit, see r/Cheetahs.
+
+=> https://git.sr.ht/~nytpu/cheetah-bot cheetah-bot source code
+
+`
linkGemini := fmt.Sprintf("=> D%03d.jpg %04d-%02d-%02d - Day %[1]d: %[5]s", day, curYear, curMonth, curDay, description)
// do the final culminating posts
@@ -126,16 +136,16 @@ func main() {
// skip i lines in old file
reader := bufio.NewReader(geminiOrig)
- total := 0
+ var total int64 = 0
for i := 0; i < 9; i++ {
row, err := reader.ReadSlice('\n')
if err != nil {
fmt.Println("Failed to get skip line in file: ", err)
os.Exit(1)
}
- total += len(row)
+ total += int64(len(row))
}
- _, err = geminiOrig.Seek(int64(total), io.SeekStart)
+ _, err = geminiOrig.Seek(total, io.SeekStart)
if err != nil {
fmt.Println("Failed to seek in file: ", err)
os.Exit(1)
@@ -169,8 +179,8 @@ func main() {
if err != nil {
fmt.Printf("Failed to rename \"%v\": %v", filename, err)
}
- /*err = os.Remove(descriptionFilename)
+ err = os.Remove(descriptionFilename)
if err != nil {
fmt.Printf("Failed to remove \"%v\": %v", filename, err)
- }*/
+ }
}