This commit is contained in:
blank X 2021-08-11 20:22:30 +07:00
parent 301edec262
commit 6926e9f3e4
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
4 changed files with 25 additions and 24 deletions

20
main.go
View File

@ -1,18 +1,18 @@
package main
import (
"os"
"fmt"
"log"
"sort"
"time"
"errors"
"context"
"strings"
"net/url"
"crypto/x509"
"encoding/xml"
"errors"
"fmt"
"log"
"net/url"
"os"
"path/filepath"
"sort"
"strings"
"time"
"git.sr.ht/~adnano/go-gemini"
"git.sr.ht/~adnano/go-gemini/tofu"
@ -181,10 +181,10 @@ func main() {
if len(aw.Items) == 0 {
feed.Updated = time.Now().Format(time.RFC3339)
} else {
feed.Updated = aw.Items[len(aw.Items) - 1].Date.Format(time.RFC3339)
feed.Updated = aw.Items[len(aw.Items)-1].Date.Format(time.RFC3339)
}
for i := len(aw.Items); i != 0; i-- {
item := aw.Items[i - 1]
item := aw.Items[i-1]
link, err := req.URL.Parse(item.Link)
if err != nil {
log.Fatal(err)

View File

@ -1,9 +1,9 @@
package main
import (
"time"
"strings"
"encoding/xml"
"strings"
"time"
"git.sr.ht/~adnano/go-gemini"
)
@ -41,6 +41,7 @@ type FeedItem struct {
}
type ByTime []FeedItem
func (a ByTime) Len() int {
return len(a)
}

View File

@ -1,12 +1,12 @@
package main
import (
"os"
"bufio"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"net/url"
"path/filepath"
"git.sr.ht/~adnano/go-gemini"
)

View File

@ -1,11 +1,11 @@
package main
import (
"os"
"bufio"
"strings"
"net/url"
"os"
"path/filepath"
"strings"
)
var predirs map[string]*url.URL