tdiary-contrib 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tdiary/contrib/version.rb +1 -1
- data/plugin/flickr.rb +9 -26
- data/plugin/google_analytics_ga.rb +68 -0
- data/plugin/gyazo.rb +68 -7
- data/plugin/oembed.rb +191 -0
- data/plugin/ogp.rb +13 -3
- data/spec/google_analytics_ga_spec.rb +59 -0
- data/util/tdiary-mode/README.org +69 -0
- data/util/tdiary-mode/tdiary-mode.el +503 -310
- metadata +8 -7
- data/util/tdiary-mode/http.el +0 -130
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tdiary-contrib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tDiary contributors
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: tdiary
|
|
@@ -293,6 +292,7 @@ files:
|
|
|
293
292
|
- plugin/goo_gl.rb
|
|
294
293
|
- plugin/google_adsense.rb
|
|
295
294
|
- plugin/google_analytics.rb
|
|
295
|
+
- plugin/google_analytics_ga.rb
|
|
296
296
|
- plugin/google_map.rb
|
|
297
297
|
- plugin/google_photos.rb
|
|
298
298
|
- plugin/google_sitemaps.rb
|
|
@@ -349,6 +349,7 @@ files:
|
|
|
349
349
|
- plugin/nhk_program_info.rb
|
|
350
350
|
- plugin/nicovideo.rb
|
|
351
351
|
- plugin/notify_miniblog.rb
|
|
352
|
+
- plugin/oembed.rb
|
|
352
353
|
- plugin/ogp.rb
|
|
353
354
|
- plugin/ohmsha_estore.rb
|
|
354
355
|
- plugin/openbd.rb
|
|
@@ -422,6 +423,7 @@ files:
|
|
|
422
423
|
- spec/flicker_spec.rb
|
|
423
424
|
- spec/gist_spec.rb
|
|
424
425
|
- spec/github_link_spec.rb
|
|
426
|
+
- spec/google_analytics_ga_spec.rb
|
|
425
427
|
- spec/google_analytics_spec.rb
|
|
426
428
|
- spec/google_universal_analytics_spec.rb
|
|
427
429
|
- spec/jdate_spec.rb
|
|
@@ -521,7 +523,7 @@ files:
|
|
|
521
523
|
- util/tdiary-for-ruby1.9/tdiary-2.3.1.patch
|
|
522
524
|
- util/tdiary-grep/README
|
|
523
525
|
- util/tdiary-grep/grep.rb
|
|
524
|
-
- util/tdiary-mode/
|
|
526
|
+
- util/tdiary-mode/README.org
|
|
525
527
|
- util/tdiary-mode/tdiary-mode.el
|
|
526
528
|
- util/tdiary-vim/ChangeLog
|
|
527
529
|
- util/tdiary-vim/README
|
|
@@ -530,7 +532,6 @@ homepage: http://www.tdiary.org/
|
|
|
530
532
|
licenses:
|
|
531
533
|
- GPL-2 and/or others
|
|
532
534
|
metadata: {}
|
|
533
|
-
post_install_message:
|
|
534
535
|
rdoc_options: []
|
|
535
536
|
require_paths:
|
|
536
537
|
- lib
|
|
@@ -545,8 +546,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
545
546
|
- !ruby/object:Gem::Version
|
|
546
547
|
version: '0'
|
|
547
548
|
requirements: []
|
|
548
|
-
rubygems_version: 3.
|
|
549
|
-
signing_key:
|
|
549
|
+
rubygems_version: 3.6.9
|
|
550
550
|
specification_version: 4
|
|
551
551
|
summary: tDiary contributions package
|
|
552
552
|
test_files:
|
|
@@ -561,6 +561,7 @@ test_files:
|
|
|
561
561
|
- spec/flicker_spec.rb
|
|
562
562
|
- spec/gist_spec.rb
|
|
563
563
|
- spec/github_link_spec.rb
|
|
564
|
+
- spec/google_analytics_ga_spec.rb
|
|
564
565
|
- spec/google_analytics_spec.rb
|
|
565
566
|
- spec/google_universal_analytics_spec.rb
|
|
566
567
|
- spec/jdate_spec.rb
|
data/util/tdiary-mode/http.el
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
;;; http.el -- utils for HTTP
|
|
2
|
-
|
|
3
|
-
;; Copyright (C) 2002 Junichiro Kita
|
|
4
|
-
|
|
5
|
-
;; Author: Junichiro Kita <kita@kitaj.no-ip.com>
|
|
6
|
-
|
|
7
|
-
;; $Id: http.el,v 1.3 2005/07/20 08:39:56 tadatadashi Exp $
|
|
8
|
-
;;
|
|
9
|
-
;; This program is free software; you can redistribute it and/or
|
|
10
|
-
;; modify it under the terms of the GNU General Public License as
|
|
11
|
-
;; published by the Free Software Foundation; either version 2, or (at
|
|
12
|
-
;; your option) any later version.
|
|
13
|
-
|
|
14
|
-
;; This program is distributed in the hope that it will be useful, but
|
|
15
|
-
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
-
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17
|
-
;; General Public License for more details.
|
|
18
|
-
|
|
19
|
-
;; You should have received a copy of the GNU General Public License
|
|
20
|
-
;; along with this program; see the file COPYING. If not, write to the
|
|
21
|
-
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22
|
-
;; Boston, MA 02111-1307, USA.
|
|
23
|
-
|
|
24
|
-
;;; Commentary:
|
|
25
|
-
|
|
26
|
-
;;; Code:
|
|
27
|
-
|
|
28
|
-
(require 'pces)
|
|
29
|
-
|
|
30
|
-
(defvar http-proxy-server nil "Proxy server for HTTP.")
|
|
31
|
-
(defvar http-proxy-port nil "Proxy port for HTTP.")
|
|
32
|
-
|
|
33
|
-
(defvar http-timeout 10
|
|
34
|
-
"Timeout for HTTP.")
|
|
35
|
-
|
|
36
|
-
;; derived from url.el
|
|
37
|
-
(defconst http-url-unreserved-chars
|
|
38
|
-
'(
|
|
39
|
-
?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
|
|
40
|
-
?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z
|
|
41
|
-
?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9
|
|
42
|
-
?$ ?- ?_ ?. ?! ?~ ?* ?' ?\( ?\) ?,)
|
|
43
|
-
"A list of characters that are _NOT_ reserve in the URL spec.
|
|
44
|
-
This is taken from draft-fielding-url-syntax-02.txt - check your local
|
|
45
|
-
internet drafts directory for a copy.")
|
|
46
|
-
|
|
47
|
-
;; derived from url.el
|
|
48
|
-
(defun http-url-hexify-string (str coding)
|
|
49
|
-
"Escape characters in a string.
|
|
50
|
-
At first, encode STR using CODING, then url-hexify."
|
|
51
|
-
(mapconcat
|
|
52
|
-
(function
|
|
53
|
-
(lambda (char)
|
|
54
|
-
(if (not (memq char http-url-unreserved-chars))
|
|
55
|
-
(if (< char 16)
|
|
56
|
-
(upcase (format "%%0%x" char))
|
|
57
|
-
(upcase (format "%%%x" char)))
|
|
58
|
-
(char-to-string char))))
|
|
59
|
-
(encode-coding-string str coding) ""))
|
|
60
|
-
|
|
61
|
-
(defvar http-fetch-terminator "</body>"
|
|
62
|
-
"content body end mark.")
|
|
63
|
-
(defun http-fetch (url method &optional user pass data)
|
|
64
|
-
"Fetch via HTTP.
|
|
65
|
-
|
|
66
|
-
URL is a url to be POSTed.
|
|
67
|
-
METHOD is 'get or 'post.
|
|
68
|
-
USER and PASS must be a valid username and password, if required.
|
|
69
|
-
DATA is an alist, each element is in the form of (FIELD . DATA).
|
|
70
|
-
|
|
71
|
-
If no error, return a buffer which contains output from the web server.
|
|
72
|
-
If error, return a cons cell (ERRCODE . DESCRIPTION)."
|
|
73
|
-
(let (connection server port path buf str len)
|
|
74
|
-
(string-match "^http://\\([^/:]+\\)\\(:\\([0-9]+\\)\\)?\\(/.*$\\)" url)
|
|
75
|
-
(setq server (match-string 1 url)
|
|
76
|
-
port (string-to-int (or (match-string 3 url) "80"))
|
|
77
|
-
path (if http-proxy-server url (match-string 4 url)))
|
|
78
|
-
(setq str (mapconcat
|
|
79
|
-
'(lambda (x)
|
|
80
|
-
(concat (car x) "=" (cdr x)))
|
|
81
|
-
data "&"))
|
|
82
|
-
(setq len (length str))
|
|
83
|
-
(save-excursion
|
|
84
|
-
(setq buf (get-buffer-create (concat "*result from " server "*")))
|
|
85
|
-
(set-buffer buf)
|
|
86
|
-
(erase-buffer)
|
|
87
|
-
(setq connection
|
|
88
|
-
(as-binary-process
|
|
89
|
-
(open-network-stream (concat "*request to " server "*")
|
|
90
|
-
buf
|
|
91
|
-
(or http-proxy-server server)
|
|
92
|
-
(or http-proxy-port port))))
|
|
93
|
-
(process-send-string
|
|
94
|
-
connection
|
|
95
|
-
(concat (if (eq method 'post)
|
|
96
|
-
(concat "POST " path)
|
|
97
|
-
(concat "GET " path (if (> len 0)
|
|
98
|
-
(concat "?" str))))
|
|
99
|
-
" HTTP/1.0\r\n"
|
|
100
|
-
(concat "Host: " server "\r\n")
|
|
101
|
-
"Connection: close\r\n"
|
|
102
|
-
"Referer: " url "\r\n"
|
|
103
|
-
"Content-type: application/x-www-form-urlencoded\r\n"
|
|
104
|
-
(if (and user pass)
|
|
105
|
-
(concat "Authorization: Basic "
|
|
106
|
-
(base64-encode-string
|
|
107
|
-
(concat user ":" pass))
|
|
108
|
-
"\r\n"))
|
|
109
|
-
(if (eq method 'post)
|
|
110
|
-
(concat "Content-length: " (int-to-string len) "\r\n"
|
|
111
|
-
"\r\n"
|
|
112
|
-
str))
|
|
113
|
-
"\r\n"))
|
|
114
|
-
(goto-char (point-min))
|
|
115
|
-
(while (not (search-forward http-fetch-terminator nil t))
|
|
116
|
-
(unless (accept-process-output connection http-timeout)
|
|
117
|
-
(error "HTTP fetch: Connection timeout!"))
|
|
118
|
-
(goto-char (point-min)))
|
|
119
|
-
(goto-char (point-min))
|
|
120
|
-
(save-excursion
|
|
121
|
-
(if (re-search-forward "HTTP/1.[01] \\([0-9][0-9][0-9]\\) \\(.*\\)" nil t)
|
|
122
|
-
(let ((code (match-string 1))
|
|
123
|
-
(desc (match-string 2)))
|
|
124
|
-
(cond ((equal code "200")
|
|
125
|
-
buf)
|
|
126
|
-
(t
|
|
127
|
-
(cons code desc)))))))))
|
|
128
|
-
|
|
129
|
-
(provide 'http)
|
|
130
|
-
;;; http.el ends here
|