Skip to content

Commit

Permalink
fix: imgur is not fecthing, probably missing client-id
Browse files Browse the repository at this point in the history
  • Loading branch information
slurdge committed Jan 5, 2024
1 parent aed0a75 commit c7c1380
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
python3 gox.py
-osarch="linux/386 linux/amd64 linux/arm linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/386"
-output "build/{{.Dir}}_{{.OS}}_{{.Arch}}"
-ldflags "-w -s -X github.com/slurdge/goeland/version.GitCommit=${{ env.GIT_COMMIT }} -X github.com/slurdge/goeland/version.BuildDate=${{ env.BUILD_DATE }} -X github.com/slurdge/goeland/internal/goeland/fetch.clientID=${IMGUR_CLIENT_ID}"
-ldflags "-w -s -X github.com/slurdge/goeland/version.GitCommit=${{ env.GIT_COMMIT }} -X github.com/slurdge/goeland/version.BuildDate=${{ env.BUILD_DATE }} -X github.com/slurdge/goeland/internal/goeland/fetch.clientID=${{ secrets.IMGUR_CLIENT_ID }}"
# Commented out because
# MacOS seems unsupported
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
build-args: |
BUILD_DATE=${{ steps.var.outputs.BUILD_DATE }}
GIT_COMMIT=${{ steps.var.outputs.GIT_COMMIT }}
IMGUR_CLIENT_ID=$${ secrets.IMGUR_CLIENT_ID }}
IMGUR_CLIENT_ID=${{ secrets.IMGUR_CLIENT_ID }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
Expand Down
6 changes: 3 additions & 3 deletions internal/goeland/fetch/imgur.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fetch
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"

Expand Down Expand Up @@ -38,7 +38,7 @@ type imgurRoot struct {
var clientID = ""

func fetchImgurTag(source *goeland.Source, tag string, sort string) error {
url := "https://api.imgur.com/3/gallery/t/" + tag + "/" + sort + "/0/day"
url := "https://api.imgur.com/3/gallery/t/" + tag + "/" + sort + "/day/0"
client := http.Client{Timeout: time.Second * 3}

req, err := http.NewRequest(http.MethodGet, url, nil)
Expand All @@ -58,7 +58,7 @@ func fetchImgurTag(source *goeland.Source, tag string, sort string) error {
return err
}

data, err := ioutil.ReadAll(res.Body)
data, err := io.ReadAll(res.Body)
if err != nil {
return err
}
Expand Down

0 comments on commit c7c1380

Please sign in to comment.