Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit 7c08116

Browse files
author
hokorobi
committed
friends_timeline の取得件数を可変にした。
1 parent 31abdae commit 7c08116

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

site-lisp/twitter/api-json.l

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@
286286
(format nil "user_timeline/~A.json" target)
287287
"user_timeline.json")))
288288

289-
(defun url-friends_timeline (&optional target)
289+
(defun url-friends_timeline (&optional target count)
290290
(concat *api-url-root*
291291
"statuses/"
292292
(if target
293-
(format nil "friends_timeline/~A.json" target)
294-
"friends_timeline.json")))
293+
(format nil "friends_timeline/~A.json?count=~A" target count)
294+
(format nil "friends_timeline.json?count=~A" count))))
295295
(defun url-replies_timeline ()
296296
(concat *api-url-root*
297297
"statuses/"

site-lisp/twitter/api-xml.l

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@
223223
(format nil "user_timeline/~A.xml" target)
224224
"user_timeline.xml")))
225225

226-
(defun url-friends_timeline (&optional target)
226+
(defun url-friends_timeline (&optional target count)
227227
(concat *api-url-root*
228228
"statuses/"
229229
(if target
230-
(format nil "friends_timeline/~A.xml" target)
231-
"friends_timeline.xml")))
230+
(format nil "friends_timeline/~A.xml?count=~A" target count)
231+
(format nil "friends_timeline.xml?count=~A" count))))
232232

233233
(defun url-replies_timeline ()
234234
(concat *api-url-root*

site-lisp/twitter/api.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
(junk::junk-http-add-header "X-Twitter-Client" *client-name* headers)
128128
(junk::junk-http-add-header "X-Twitter-Client-Version" *client-version* headers)
129129
(when *client-url*
130-
(junk::junk-http-add-header "X-Twitter-Client-Url" *client-url* headers))
130+
(junk::junk-http-add-header "X-Twitter-Client-URL" *client-url* headers))
131131
(when (and username password)
132132
(junk::junk-http-add-header "Authorization"
133133
(concat "Basic "
@@ -245,7 +245,7 @@
245245
(fetch-statuses url tmpfile headers force)))
246246

247247
(defun statuses-friends_timeline (username password &optional force target)
248-
(let* ((url (url-friends_timeline target))
248+
(let* ((url (url-friends_timeline target *summary-friends-timeline-count*))
249249
(tmpfile (local-file url username))
250250
(headers (create-request-headers username password)))
251251
(fetch-statuses url tmpfile headers force)))

site-lisp/twitter/config.l.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@
5252
;(setq *summary-search-max* 20)
5353
;; 検索時の言語指定
5454
;(setq *search-lang* "ja")
55+
;; friends-timeline で取得する件数
56+
;(setq *summary-friends-timeline-count* 20)

site-lisp/twitter/summary.l

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
;(defvar *summary-search-history* nil)
2828
;(defvar *summary-search-histroy-max* 10)
2929

30+
(defvar *summary-friends-timeline-count* 20)
31+
3032
(defvar *summary-regexp-keyword-list*
3133
(compile-regexp-keyword-list
3234
'(

0 commit comments

Comments
 (0)