renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

gogle analytics seems to have stopped working in v2 #115

Closed jave closed 10 years ago

jave commented 10 years ago

previously this worked well

+ANALYTICS: UA-50054319-1

but no longer!

renard commented 10 years ago

This have been fixed in 8f673c7 Please change to #+GOOGLE_ANALYTICS: XXX

jave commented 10 years ago

doesnt seem to work for me, did you try with org?

I tried both of these:

+GOOGLE_ANALYTICS: UA-50054319-1

+GOOGLE-ANALYTICS: UA-50054319-1

I did try to follow the oblog code for a bit, but couldnt see whats wrong.

jave commented 10 years ago

Some random debuging follows.

The idea is that would be okay with just hard coding the ob:backend struct and run ob:publish on it. It seems hard to do though for some reason. I suppose I could just hand code the array.

(setq mupp (make-ob:backend:org :config-file "/home/joakim/Plans/Oblog.org" :publish-dir "/tmp/oblog") ) [cl-struct-ob:backend:org "/home/joakim/Plans/Oblog.org" nil nil nil "/tmp/oblog" "/home/joakim/.emacs.d/el-get/o-blog/templates/style" "/home/joakim/.emacs.d/el-get/o-blog/templates" nil nil nil nil nil nil nil ob:entry:sort-by-date "+TODO=\"DONE\"" "+PAGE={.+.html}" "+SNIPPET={.+}"]

ELISP> (%ob:set mupp :google-analytics "UA-50054319-1") nil

this works though. (%ob:set mupp 'publish-dir "test") "test"

(ob:get 'google-analytics (make-ob:backend :config-file "/home/joakim/Plans/Oblog.org" :google-analytics "mupp")) "mupp" ELISP> (ob:get 'google-analytics (make-ob:backend:org :config-file "/home/joakim/Plans/Oblog.org" :google-analytics "mupp")) * Eval error * Keyword argument :google-analytics not one of (:config-file :index-file :source-dir :source-files :publish-dir :style-dir :template-dir :articles :pages :snippets :tags :title :description :url :posts-sorter :articles-filter :pages-filter :snippets-filter)

renard commented 10 years ago

I guess you should reload lisp files after upgrading o-blog version. This is mainly because ob:backend:org depends on ob:backend.

ELISP> (let ((mupp (make-ob:backend:org :config-file "/tmp/site-jave/jave-oblog.org" :publish-dir "/tmp/oblog")))
     (ob:org:parse-config mupp)
     (ob:get 'google-analytics mupp))
"UA-50054319-1"
ELISP> 
jave commented 10 years ago

your above example doesnt work for me, which it obviously should.

I have reloaded, redefined, examined load path shadows, rebuilt emacs, and offered a goat to the old gods. Still no success.

jave commented 10 years ago

there is some kind of load order issue. If I explicitly redefine ob:backend, I can access the slot. Im not sure if this is a real issue, or what.

renard commented 10 years ago

Strange I will try later to find a way to diagnose it.

renard commented 10 years ago

I got this:

/Applications/Emacs.app/Contents/MacOS/Emacs --debug-init -Q -batch -L ~/.emacs.d/el-get/o-blog/lisp --eval "(progn (require 'o-blog) (require 'o-blog-backend-org))" --eval "(let ((mupp (make-ob:backend:org :config-file \"/tmp/jave/jave-oblog.org\" :publish-dir \"/tmp/oblog\"))) (ob:org:parse-config mupp) (message \"GA: %s\" (ob:get 'google-analytics mupp)))"
GA: UA-50054319-1

Do you manage to get something similar?

jave commented 10 years ago

works for me now