tumblrandom: some fixups
This commit is contained in:
parent
0b7dd5e1b3
commit
5726067315
1 changed files with 6 additions and 3 deletions
|
@ -205,7 +205,7 @@ type likesResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
refreshBuf map[string][]Post
|
refreshBuf = map[string][]Post{}
|
||||||
refreshBufMu sync.Mutex
|
refreshBufMu sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -279,6 +279,9 @@ func (a *app) refreshLikes(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
urlSuffix = lr.Response.Links.Next.Href
|
urlSuffix = lr.Response.Links.Next.Href
|
||||||
if urlSuffix != "" {
|
if urlSuffix != "" {
|
||||||
|
refreshBufMu.Lock()
|
||||||
|
refreshBuf[refreshSess] = likes
|
||||||
|
refreshBufMu.Unlock()
|
||||||
fmt.Fprintf(rw, `<!DOCTYPE html>
|
fmt.Fprintf(rw, `<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -286,8 +289,8 @@ func (a *app) refreshLikes(rw http.ResponseWriter, r *http.Request) {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form method="POST" id="theForm">
|
<form method="POST" id="theForm">
|
||||||
<input type="hidden" name="url_suffix" value="%q">
|
<input type="hidden" name="url_suffix" value=%q>
|
||||||
<input type="hidden" name="refresh_session" value="%q">
|
<input type="hidden" name="refresh_session" value=%q>
|
||||||
<input type="submit" id="theSubmit">
|
<input type="submit" id="theSubmit">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Reference in a new issue