fix(monitor/backend): gdelt switch to timelinevol mode (article-snippet source of malformed escapes is gone)
This commit is contained in:
parent
e216331aeb
commit
038de64605
|
|
@ -77,7 +77,7 @@ type rawTimeline struct {
|
|||
func (c *Client) FetchTheme(ctx context.Context, theme string) ([]ThemeBucket, error) {
|
||||
q := url.Values{}
|
||||
q.Set("query", "theme:"+theme)
|
||||
q.Set("mode", "timelinevolinfo")
|
||||
q.Set("mode", "timelinevol")
|
||||
q.Set("TIMELINESMOOTH", "5")
|
||||
q.Set("format", "json")
|
||||
q.Set("timespan", "1d")
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@ import (
|
|||
)
|
||||
|
||||
func TestClient_FetchThemeDecodesBuckets(t *testing.T) {
|
||||
body, err := os.ReadFile("testdata/timelinevolinfo.json")
|
||||
body, err := os.ReadFile("testdata/timelinevol.json")
|
||||
require.NoError(t, err)
|
||||
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
require.Equal(t, "/api/v2/doc/doc", r.URL.Path)
|
||||
require.Equal(t, "theme:NATURAL_DISASTER", r.URL.Query().Get("query"))
|
||||
require.Equal(t, "timelinevol", r.URL.Query().Get("mode"))
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write(body)
|
||||
}))
|
||||
|
|
|
|||
Loading…
Reference in New Issue