runeblog 0.3.34 → 0.3.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/global.lt3 +3 -3
- data/empty_view/global.lt3 +20 -0
- data/empty_view/themes/standard/banner/top.lt3 +1 -1
- data/empty_view/themes/standard/blog/generate.lt3 +1 -1
- data/empty_view/themes/standard/etc/blog.css.lt3 +1 -1
- data/empty_view/themes/standard/post/generate.lt3 +1 -1
- data/empty_view/themes/standard/post/permalink.lt3 +1 -1
- data/lib/exceptions.rb +2 -0
- data/lib/helpers-blog.rb +3 -3
- data/lib/liveblog.rb +24 -24
- data/lib/lowlevel.rb +35 -0
- data/lib/menus.rb +2 -2
- data/lib/processing.rb +3 -17
- data/lib/publish.rb +3 -6
- data/lib/repl.rb +3 -5
- data/lib/runeblog.rb +94 -21
- data/lib/runeblog_version.rb +6 -2
- data/lib/view.rb +9 -3
- data/runeblog.gemspec +4 -2
- data/test/.blogs/data/EDITOR +1 -0
- data/test/.blogs/data/ROOT +1 -0
- data/test/.blogs/data/VERSION +2 -0
- data/test/.blogs/data/VIEW +1 -0
- data/test/.blogs/data/features.txt +18 -0
- data/test/.blogs/data/global.lt3 +20 -0
- data/test/.blogs/data/sequence +1 -0
- data/test/.blogs/data/universal.lt3 +20 -0
- data/test/.blogs/views/around_austin/assets/austin-pano.jpg +0 -0
- data/test/.blogs/views/around_austin/assets/back-icon.png +0 -0
- data/test/.blogs/views/around_austin/assets/reddit-logo.png +0 -0
- data/test/.blogs/views/around_austin/assets/sky2.jpg +0 -0
- data/test/.blogs/views/around_austin/config/exper/2svg.lt3 +38 -0
- data/test/.blogs/views/around_austin/config/exper/gen_svg.rb +60 -0
- data/test/.blogs/views/around_austin/config/exper/meta.html +10 -0
- data/test/.blogs/views/around_austin/config/exper/s2.html +25 -0
- data/test/.blogs/views/around_austin/config/exper/varmint.rb +50 -0
- data/test/.blogs/views/around_austin/config/facebook/credentials.txt +7 -0
- data/test/.blogs/views/around_austin/config/facebook/facebook.rb +42 -0
- data/test/.blogs/views/around_austin/config/facebook/fb.html +10 -0
- data/test/.blogs/views/around_austin/config/facebook/fb.js.lt3 +15 -0
- data/test/.blogs/views/around_austin/config/reddit/credentials.txt +6 -0
- data/test/.blogs/views/around_austin/config/reddit/notes.txt +4 -0
- data/test/.blogs/views/around_austin/config/reddit/reddit_post_url.py +34 -0
- data/test/.blogs/views/around_austin/config/reddit/redpost.rb +38 -0
- data/test/.blogs/views/around_austin/config/twitter/credentials.txt +3 -0
- data/test/.blogs/views/around_austin/config/twitter/tw.html +12 -0
- data/test/.blogs/views/around_austin/config/twitter/tw.js +5 -0
- data/test/.blogs/views/around_austin/config/twitter/twitter.rb +35 -0
- data/test/.blogs/views/around_austin/data/GIT_IS_DUMB +0 -0
- data/test/.blogs/views/around_austin/global.lt3 +20 -0
- data/test/.blogs/views/around_austin/last_published +1 -0
- data/test/.blogs/views/around_austin/posts/GIT_IS_DUMB +1 -0
- data/test/.blogs/views/around_austin/remote/assets/GIT_IS_DUMB +1 -0
- data/test/.blogs/views/around_austin/remote/banner/navbar/GIT_IS_DUMB +0 -0
- data/test/.blogs/views/around_austin/remote/etc/GIT_IS_DUMB +1 -0
- data/test/.blogs/views/around_austin/remote/permalink/GIT_IS_DUMB +1 -0
- data/test/.blogs/views/around_austin/remote/widgets/ad/GIT_IS_DUMB +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/links/GIT_IS_DUMB +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/news/GIT_IS_DUMB +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pages/GIT_IS_DUMB +2 -0
- data/test/.blogs/views/around_austin/remote/widgets/pinned/GIT_IS_DUMB +2 -0
- data/test/.blogs/views/around_austin/settings/features.txt +18 -0
- data/test/.blogs/views/around_austin/settings/publish.txt +5 -0
- data/test/.blogs/views/around_austin/settings/recent.txt +11 -0
- data/test/.blogs/views/around_austin/settings/view.txt +4 -0
- data/test/.blogs/views/around_austin/themes/standard/README +59 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/banner.lt3 +5 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/navbar/about.lt3 +18 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/navbar/contact.lt3 +18 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/navbar/faq.lt3 +1 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/navbar/list.data +3 -0
- data/test/.blogs/views/around_austin/themes/standard/banner/top.lt3 +20 -0
- data/test/.blogs/views/around_austin/themes/standard/blog/generate.lt3 +21 -0
- data/test/.blogs/views/around_austin/themes/standard/blog/head.lt3 +16 -0
- data/test/.blogs/views/around_austin/themes/standard/blog/index.lt3 +16 -0
- data/test/.blogs/views/around_austin/themes/standard/blog/post_entry.lt3 +21 -0
- data/test/.blogs/views/around_austin/themes/standard/etc/blog.css.lt3 +62 -0
- data/test/.blogs/views/around_austin/themes/standard/etc/externals.lt3 +24 -0
- data/test/.blogs/views/around_austin/themes/standard/etc/favicon.ico +0 -0
- data/test/.blogs/views/around_austin/themes/standard/etc/github.css +209 -0
- data/test/.blogs/views/around_austin/themes/standard/etc/misc.js +20 -0
- data/test/.blogs/views/around_austin/themes/standard/global.lt3 +20 -0
- data/test/.blogs/views/around_austin/themes/standard/post/generate.lt3 +39 -0
- data/test/.blogs/views/around_austin/themes/standard/post/head.lt3 +7 -0
- data/test/.blogs/views/around_austin/themes/standard/post/index.lt3 +24 -0
- data/test/.blogs/views/around_austin/themes/standard/post/permalink.lt3 +31 -0
- data/test/.blogs/views/around_austin/widgets/README +4 -0
- data/test/.blogs/views/around_austin/widgets/bydates/README +2 -0
- data/test/.blogs/views/around_austin/widgets/bydates/bydates.rb +18 -0
- data/test/.blogs/views/around_austin/widgets/bydates/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/bydates/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/bydates/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/links/README +2 -0
- data/test/.blogs/views/around_austin/widgets/links/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/links/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/links/links.rb +90 -0
- data/test/.blogs/views/around_austin/widgets/links/list.data +3 -0
- data/test/.blogs/views/around_austin/widgets/links/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/news/README +2 -0
- data/test/.blogs/views/around_austin/widgets/news/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/news/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/news/list.data +4 -0
- data/test/.blogs/views/around_austin/widgets/news/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/news/news.rb +88 -0
- data/test/.blogs/views/around_austin/widgets/pages/README +2 -0
- data/test/.blogs/views/around_austin/widgets/pages/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/pages/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/pages/disclaim.lt3 +10 -0
- data/test/.blogs/views/around_austin/widgets/pages/faq.lt3 +41 -0
- data/test/.blogs/views/around_austin/widgets/pages/like-dislike.lt3 +11 -0
- data/test/.blogs/views/around_austin/widgets/pages/list.data +4 -0
- data/test/.blogs/views/around_austin/widgets/pages/local.rb +0 -0
- data/test/.blogs/views/around_austin/widgets/pages/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/pages/other-stuff.lt3 +10 -0
- data/test/.blogs/views/around_austin/widgets/pages/pages.rb +130 -0
- data/test/.blogs/views/around_austin/widgets/pinned/README +2 -0
- data/test/.blogs/views/around_austin/widgets/pinned/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/pinned/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/pinned/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/pinned/pinned.rb +111 -0
- data/test/.blogs/views/around_austin/widgets/search/README +2 -0
- data/test/.blogs/views/around_austin/widgets/search/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/search/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/search/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/search/search.rb +18 -0
- data/test/.blogs/views/around_austin/widgets/sitemap/README +2 -0
- data/test/.blogs/views/around_austin/widgets/sitemap/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/sitemap/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/sitemap/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/sitemap/sitemap.rb +18 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/OLD-example.lt3 +12 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/README +2 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/card.css +1 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/custom.rb +1 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/main.css +2 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/tag-cloud.lt3 +3 -0
- data/test/.blogs/views/around_austin/widgets/tag-cloud/tag-cloud.rb +18 -0
- data/test/.blogs/widgets/README +4 -0
- data/test/.blogs/widgets/bydates/README +2 -0
- data/test/.blogs/widgets/bydates/bydates.rb +18 -0
- data/test/.blogs/widgets/bydates/card.css +1 -0
- data/test/.blogs/widgets/bydates/custom.rb +1 -0
- data/test/.blogs/widgets/bydates/main.css +2 -0
- data/test/.blogs/widgets/links/README +2 -0
- data/test/.blogs/widgets/links/card.css +1 -0
- data/test/.blogs/widgets/links/custom.rb +1 -0
- data/test/.blogs/widgets/links/links.rb +90 -0
- data/test/.blogs/widgets/links/list.data +3 -0
- data/test/.blogs/widgets/links/main.css +2 -0
- data/test/.blogs/widgets/news/README +2 -0
- data/test/.blogs/widgets/news/card.css +1 -0
- data/test/.blogs/widgets/news/custom.rb +1 -0
- data/test/.blogs/widgets/news/list.data +4 -0
- data/test/.blogs/widgets/news/main.css +2 -0
- data/test/.blogs/widgets/news/news.rb +88 -0
- data/test/.blogs/widgets/pages/README +2 -0
- data/test/.blogs/widgets/pages/card.css +1 -0
- data/test/.blogs/widgets/pages/custom.rb +1 -0
- data/test/.blogs/widgets/pages/disclaim.lt3 +10 -0
- data/test/.blogs/widgets/pages/faq.lt3 +41 -0
- data/test/.blogs/widgets/pages/like-dislike.lt3 +11 -0
- data/test/.blogs/widgets/pages/list.data +4 -0
- data/test/.blogs/widgets/pages/local.rb +0 -0
- data/test/.blogs/widgets/pages/main.css +2 -0
- data/test/.blogs/widgets/pages/other-stuff.lt3 +10 -0
- data/test/.blogs/widgets/pages/pages.rb +130 -0
- data/test/.blogs/widgets/pinned/README +2 -0
- data/test/.blogs/widgets/pinned/card.css +1 -0
- data/test/.blogs/widgets/pinned/custom.rb +1 -0
- data/test/.blogs/widgets/pinned/main.css +2 -0
- data/test/.blogs/widgets/pinned/pinned.rb +111 -0
- data/test/.blogs/widgets/search/README +2 -0
- data/test/.blogs/widgets/search/card.css +1 -0
- data/test/.blogs/widgets/search/custom.rb +1 -0
- data/test/.blogs/widgets/search/main.css +2 -0
- data/test/.blogs/widgets/search/search.rb +18 -0
- data/test/.blogs/widgets/sitemap/README +2 -0
- data/test/.blogs/widgets/sitemap/card.css +1 -0
- data/test/.blogs/widgets/sitemap/custom.rb +1 -0
- data/test/.blogs/widgets/sitemap/main.css +2 -0
- data/test/.blogs/widgets/sitemap/sitemap.rb +18 -0
- data/test/.blogs/widgets/tag-cloud/OLD-example.lt3 +12 -0
- data/test/.blogs/widgets/tag-cloud/README +2 -0
- data/test/.blogs/widgets/tag-cloud/card.css +1 -0
- data/test/.blogs/widgets/tag-cloud/custom.rb +1 -0
- data/test/.blogs/widgets/tag-cloud/main.css +2 -0
- data/test/.blogs/widgets/tag-cloud/tag-cloud.lt3 +3 -0
- data/test/.blogs/widgets/tag-cloud/tag-cloud.rb +18 -0
- data/test/austin.rb +8 -3
- metadata +176 -6
@@ -0,0 +1 @@
|
|
1
|
+
/Users/Hal/Dropbox/topx/git/runeblog/test/.blogs
|
@@ -0,0 +1 @@
|
|
1
|
+
around_austin
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# 0 = disabled (installed but disabled)
|
2
|
+
# 1 = enabled (implies installed)
|
3
|
+
# x = excluded (not installed; does it even exist?)
|
4
|
+
|
5
|
+
reddit 0 # autopost, embed thread after blog post
|
6
|
+
facebook 0 # reader-like, reader post, autopost?
|
7
|
+
twitter 0 # reader-tweet, reader-follow, autotweet?
|
8
|
+
|
9
|
+
links 1 # widget: external links
|
10
|
+
news 1 # widget: news (external)
|
11
|
+
pages 1 # widget: internal pages
|
12
|
+
pinned 1 # widget: pinned posts
|
13
|
+
|
14
|
+
ad x # widget: embed advertising
|
15
|
+
bydates x # widget: browse posts by date
|
16
|
+
search x # widget: search posts
|
17
|
+
sitemap x # widget: site map
|
18
|
+
tag_cloud x # widget: tag cloud (clickable)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
. --------------------------------------------------
|
2
|
+
. Global settings are stored here in the form
|
3
|
+
. <variable> <value>
|
4
|
+
. --------------------------------------------------
|
5
|
+
|
6
|
+
.variables view ../../settings/view.txt
|
7
|
+
|
8
|
+
.variables recent ../../settings/recent.txt
|
9
|
+
|
10
|
+
.variables publish ../../settings/publish.txt
|
11
|
+
|
12
|
+
.variables
|
13
|
+
host http://SITE
|
14
|
+
charset utf-8
|
15
|
+
url http://SITE
|
16
|
+
locale en_US
|
17
|
+
|
18
|
+
font.family verdana
|
19
|
+
.end
|
20
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
0
|
@@ -0,0 +1,20 @@
|
|
1
|
+
. "Universal" settings -- new defaults for global.lt3
|
2
|
+
. work in progress - defaults for each global.lt3
|
3
|
+
|
4
|
+
. --------------------------------------------------
|
5
|
+
. Global settings are stored here in the form
|
6
|
+
. <variable> <value>
|
7
|
+
. --------------------------------------------------
|
8
|
+
.nopara
|
9
|
+
|
10
|
+
.set Root=REPO_ROOT
|
11
|
+
|
12
|
+
.variables
|
13
|
+
univ.author AUTHOR
|
14
|
+
univ.site SITE_DOMAIN
|
15
|
+
|
16
|
+
font.family verdana
|
17
|
+
|
18
|
+
charset utf-8
|
19
|
+
locale en_US
|
20
|
+
.end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,38 @@
|
|
1
|
+
.nopara
|
2
|
+
.variables
|
3
|
+
blog Around Austin
|
4
|
+
blog.desc The view from downtown
|
5
|
+
|
6
|
+
viewbox.wide 550
|
7
|
+
viewbox.high 90
|
8
|
+
|
9
|
+
rect.wide 550
|
10
|
+
rect.high 90
|
11
|
+
rect.fill blue
|
12
|
+
|
13
|
+
title.font bold 58px sans-serif
|
14
|
+
title.fill white
|
15
|
+
title.xoff 280
|
16
|
+
title.yoff 55
|
17
|
+
|
18
|
+
subtitle.font italic 24px sans-serif
|
19
|
+
subtitle.fill lightblue
|
20
|
+
subtitle.xoff 280
|
21
|
+
subtitle.yoff 80
|
22
|
+
.end
|
23
|
+
|
24
|
+
<svg width=$viewbox.wide height=$viewbox.high
|
25
|
+
viewBox="0 0 $viewbox.wide $viewbox.high"
|
26
|
+
xmlns="http://www.w3.org/2000/svg">
|
27
|
+
<style>
|
28
|
+
.subtitle { font: $subtitle.font; fill: $subtitle.fill }
|
29
|
+
.title { font: $title.font; fill: $title.fill }
|
30
|
+
</style>
|
31
|
+
|
32
|
+
<rect x="0" y="0" rx="10" ry="10" width="$rect.wide" height="$rect.high" fill="$rect.fill"/>
|
33
|
+
|
34
|
+
<text text-anchor="middle" x=$title.xoff y=$title.yoff class=title>$blog</text>
|
35
|
+
<text text-anchor="middle" x=$subtitle.xoff y=$subtitle.yoff class=subtitle>$blog.desc</text>
|
36
|
+
</svg>
|
37
|
+
<br>
|
38
|
+
Here we are
|
@@ -0,0 +1,60 @@
|
|
1
|
+
width = 550
|
2
|
+
title = "My Stuff" # 13 -> 58, 8 -> 13/8 * 58
|
3
|
+
sub = "I always wanted a place for it" # 22 -> 24, 31 -> 15
|
4
|
+
|
5
|
+
tlen, slen = title.length, sub.length
|
6
|
+
tfont = 58
|
7
|
+
sfont = 18
|
8
|
+
|
9
|
+
=begin
|
10
|
+
.svg_titles
|
11
|
+
title style: bold size: 20px face: sans-serif color: white
|
12
|
+
title2 italic 10px sans-serif
|
13
|
+
width 550
|
14
|
+
height 90
|
15
|
+
bgcolor blue
|
16
|
+
title_xy 82 55 left
|
17
|
+
title2_xy 210 80
|
18
|
+
.end
|
19
|
+
=end
|
20
|
+
|
21
|
+
puts <<-EOS
|
22
|
+
.nopara
|
23
|
+
.variables
|
24
|
+
blog #{title}
|
25
|
+
blog.desc #{sub}
|
26
|
+
|
27
|
+
viewbox.wide 550
|
28
|
+
viewbox.high 90
|
29
|
+
|
30
|
+
rect.wide 550
|
31
|
+
rect.high 90
|
32
|
+
rect.fill blue
|
33
|
+
|
34
|
+
title.font bold #{tfont}px sans-serif
|
35
|
+
title.fill white
|
36
|
+
title.xoff 82
|
37
|
+
title.yoff 55
|
38
|
+
|
39
|
+
subtitle.font italic #{sfont}px sans-serif
|
40
|
+
subtitle.fill lightblue
|
41
|
+
subtitle.xoff 210
|
42
|
+
subtitle.yoff 80
|
43
|
+
.end
|
44
|
+
|
45
|
+
<svg width=$viewbox.wide height=$viewbox.high
|
46
|
+
viewBox="0 0 $viewbox.wide $viewbox.high"
|
47
|
+
xmlns="http://www.w3.org/2000/svg">
|
48
|
+
<style>
|
49
|
+
.subtitle { font: $subtitle.font; fill: $subtitle.fill }
|
50
|
+
.title { font: $title.font; fill: $title.fill }
|
51
|
+
</style>
|
52
|
+
|
53
|
+
<rect x="0" y="0" rx="10" ry="10" width="$rect.wide" height="$rect.high" fill="$rect.fill"/>
|
54
|
+
|
55
|
+
<text x=$title.xoff y=$title.yoff class=title>$blog</text>
|
56
|
+
<text x=$subtitle.xoff y=$subtitle.yoff class=subtitle>$blog.desc</text>
|
57
|
+
</svg>
|
58
|
+
<br>
|
59
|
+
Here we are
|
60
|
+
EOS
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
<!-- meta tags: separate out? -->
|
3
|
+
|
4
|
+
<!-- meta property='fb:admins' content='767352779' /> -->
|
5
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
6
|
+
<meta property='og:type' content='article'/>
|
7
|
+
<meta property='og:title' content='#{title}'/>
|
8
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
9
|
+
<meta property='og:description' content='#{teaser}'/>
|
10
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<table>
|
2
|
+
<tr>
|
3
|
+
<td wudth=300>
|
4
|
+
<h1>And here we are...</h1>
|
5
|
+
</td>
|
6
|
+
|
7
|
+
<td>
|
8
|
+
<svg width=550 height=90
|
9
|
+
viewBox="0 0 550 90"
|
10
|
+
xmlns="http://www.w3.org/2000/svg">
|
11
|
+
<style>
|
12
|
+
.subtitle { font: italic 24px sans-serif; fill: lightblue }
|
13
|
+
.title { font: bold 58px sans-serif; fill: white }
|
14
|
+
</style>
|
15
|
+
|
16
|
+
<rect x="0" y="0" rx="10" ry="10" width="550" height="90" fill="blue"/>
|
17
|
+
|
18
|
+
<text text-anchor="middle" x=280 y=55 class=title>Around Austin</text>
|
19
|
+
<text text-anchor="middle" x=280 y=80 class=subtitle>The view from downtown</text>
|
20
|
+
</svg>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
<table>
|
24
|
+
<br>
|
25
|
+
Here we are
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
3
|
+
class OpenStruct
|
4
|
+
def to_s
|
5
|
+
"[not a value]"
|
6
|
+
end
|
7
|
+
|
8
|
+
def inspect
|
9
|
+
to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class OpenVar
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@hash = {}
|
17
|
+
@obj = OpenStruct.new
|
18
|
+
end
|
19
|
+
|
20
|
+
def [](var)
|
21
|
+
puts "self = #{self.inspect}"
|
22
|
+
# @hash[var] = nil
|
23
|
+
pieces = var.split(".")
|
24
|
+
this = @obj
|
25
|
+
pieces.each do |piece|
|
26
|
+
puts "piece = #{piece}"
|
27
|
+
# this.send(piece.to_s+"=", OpenStruct.new)
|
28
|
+
this = this.send(piece)
|
29
|
+
puts "this = #{this.inspect}"
|
30
|
+
end
|
31
|
+
this
|
32
|
+
end
|
33
|
+
|
34
|
+
def method_missing(meth, *args)
|
35
|
+
setter = meth.to_s + "="
|
36
|
+
meh = @obj.send(setter, OpenStruct.new)
|
37
|
+
@obj
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
var = OpenVar.new
|
44
|
+
|
45
|
+
var.foo.bar = 237
|
46
|
+
|
47
|
+
puts var.foo.inspect
|
48
|
+
puts var.foo.bar.inspect
|
49
|
+
|
50
|
+
puts var["foo.bar"]
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class Livetext::Functions
|
2
|
+
|
3
|
+
def facebook_init
|
4
|
+
fb_appid = _var("facebook.appid")
|
5
|
+
xfbml = _var("facebook.xfbml")
|
6
|
+
ver = _var("facebook.version")
|
7
|
+
width = _var("facebook.width")
|
8
|
+
share = _var("facebook.share")
|
9
|
+
faces = _var("facebook.faces")
|
10
|
+
<<~HTML
|
11
|
+
window.fbAsyncInit = function() {
|
12
|
+
FB.init({
|
13
|
+
appId : '#{fb_appid}',
|
14
|
+
xfbml : #{xfbml},
|
15
|
+
version : '#{ver}'
|
16
|
+
});
|
17
|
+
};
|
18
|
+
HTML
|
19
|
+
end
|
20
|
+
|
21
|
+
=begin
|
22
|
+
<!-- Needed:
|
23
|
+
<meta property='fb:admins' content='$facebook.admins'/>
|
24
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
25
|
+
<meta property='og:type' content='article'/>
|
26
|
+
<meta property='og:title' content='#{title}'/>
|
27
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
28
|
+
<meta property='og:description' content='#{teaser}'/>
|
29
|
+
-->
|
30
|
+
=end
|
31
|
+
|
32
|
+
def facebook_likes
|
33
|
+
<<~HTML
|
34
|
+
<div class='fb-like'
|
35
|
+
data-share='#{share}'
|
36
|
+
data-width='#{width}'
|
37
|
+
data-show-faces='#{faces}'>
|
38
|
+
</div>
|
39
|
+
HTML
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.variables facebook credentials.txt
|
2
|
+
|
3
|
+
<script>
|
4
|
+
window.fbAsyncInit = function() {
|
5
|
+
FB.init({
|
6
|
+
appId : '$facebook.appid',
|
7
|
+
xfbml : $facebook.xfbml,
|
8
|
+
version : '$facebook.ver'
|
9
|
+
});
|
10
|
+
};
|
11
|
+
|
12
|
+
callout(document, 'facebook-jssdk',
|
13
|
+
'//connect.facebook.net/en_US/sdk.js');
|
14
|
+
</script>
|
15
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
import re
|
3
|
+
import praw
|
4
|
+
|
5
|
+
f = open("reddit/credentials.txt", "r")
|
6
|
+
lines = f.readlines()
|
7
|
+
f.close()
|
8
|
+
|
9
|
+
dict = {}
|
10
|
+
for line in lines:
|
11
|
+
data = re.split(" +", line)
|
12
|
+
dict[data[0]] = data[1].rstrip()
|
13
|
+
|
14
|
+
|
15
|
+
reddit = praw.Reddit(user_agent = dict['user_agent'],
|
16
|
+
client_id = dict['client_id'],
|
17
|
+
client_secret = dict['client_secret'],
|
18
|
+
username = dict['username'],
|
19
|
+
password = dict['password'])
|
20
|
+
|
21
|
+
file = open("/tmp/reddit-post-url.txt", "r") # gaahhh
|
22
|
+
lines = file.readlines()
|
23
|
+
title = lines[0].rstrip()
|
24
|
+
url = lines[1].rstrip()
|
25
|
+
|
26
|
+
subred = reddit.subreddit(dict['subreddit'])
|
27
|
+
rid = subred.submit(title = title, url = url)
|
28
|
+
|
29
|
+
print(rid)
|
30
|
+
|
31
|
+
# submission = reddit.submission(id='edmcwf')
|
32
|
+
# print(submission.title)
|
33
|
+
# print(submission.url)
|
34
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
app_name = "raido1"
|
2
|
+
app_client = "rAyZILgqGB7uHQ"
|
3
|
+
secret = "0CqLXyFu6ABb1MrErWRsB7Bo-i8"
|
4
|
+
|
5
|
+
# https://www.reddit.com/api/v1/authorize?client_id=rAyZILgqGB7uHQ&response_type=code&state=abc237def&redirect_uri=http%3A%2F%2Frubyhacker.com&duration=permanent&scope=identity%20edit%20flair%20history%20modconfig%20modflair%20modlog%20modposts%20modwiki%20mysubreddits%20privatemessages%20read%20report%20save%20submit%20subscribe%20vote%20wikiedit%20wikiread
|
6
|
+
|
7
|
+
require 'net/http'
|
8
|
+
require 'uri'
|
9
|
+
require 'json'
|
10
|
+
|
11
|
+
=begin
|
12
|
+
get_token = URI.parse("https://www.reddit.com/api/v1/access_token")
|
13
|
+
data = {
|
14
|
+
grant_type: authorization_code
|
15
|
+
code=CODE
|
16
|
+
redirect_uri=URI
|
17
|
+
}
|
18
|
+
=end
|
19
|
+
|
20
|
+
uri = URI.parse("http://reddit.com/api/submit")
|
21
|
+
|
22
|
+
header = {'Content-Type': 'text/json'}
|
23
|
+
data = {
|
24
|
+
sr: "RubyElixirEtc",
|
25
|
+
kind: "link",
|
26
|
+
title: "[Post] This is my title",
|
27
|
+
url: "http://rubyhacker.com/around_austin/permalink/the-graffiti-wall.html"
|
28
|
+
}
|
29
|
+
|
30
|
+
# Create the HTTP objects
|
31
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
32
|
+
request = Net::HTTP::Post.new(uri.request_uri, header)
|
33
|
+
request.body = user.to_json
|
34
|
+
|
35
|
+
# Send the request
|
36
|
+
response = http.request(request)
|
37
|
+
|
38
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
<!-- Twitter: share, follow -->
|
3
|
+
|
4
|
+
<a href='https://twitter.com/share'
|
5
|
+
class='twitter-share-button'
|
6
|
+
data-text='#{title}'
|
7
|
+
data-url='#{'url'}'
|
8
|
+
data-via='hal_fulton'
|
9
|
+
data-related='hal_fulton'>Tweet</a>
|
10
|
+
|
11
|
+
<a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
|
12
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Livetext::Functions
|
2
|
+
|
3
|
+
# Needed for Twitter??
|
4
|
+
|
5
|
+
=begin
|
6
|
+
<!-- Needed: btw what is 'content'?
|
7
|
+
<meta property='fb:admins' content='767352779'/>
|
8
|
+
<meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
|
9
|
+
<meta property='og:type' content='article'/>
|
10
|
+
<meta property='og:title' content='#{title}'/>
|
11
|
+
<meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
|
12
|
+
<meta property='og:description' content='#{teaser}'/>
|
13
|
+
-->
|
14
|
+
=end
|
15
|
+
|
16
|
+
def twitter_share(title, url)
|
17
|
+
name = _var("twitter.user")
|
18
|
+
<<~HTML
|
19
|
+
<a href='https://twitter.com/share'
|
20
|
+
class='twitter-share-button'
|
21
|
+
data-text='#{title}'
|
22
|
+
data-url='#{url}'
|
23
|
+
data-via='#{name}'
|
24
|
+
data-related='#{name}'>Tweet</a>
|
25
|
+
HTML
|
26
|
+
end
|
27
|
+
|
28
|
+
def twitter_follow
|
29
|
+
name = _var("twitter.user")
|
30
|
+
<<~HTML
|
31
|
+
<a href='https://twitter.com/#{name}' class='twitter-follow-button' data-show-count='false'>Follow @#{name}</a>
|
32
|
+
HTML
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
. --------------------------------------------------
|
2
|
+
. Global settings are stored here in the form
|
3
|
+
. <variable> <value>
|
4
|
+
. --------------------------------------------------
|
5
|
+
|
6
|
+
.variables view ../../settings/view.txt
|
7
|
+
|
8
|
+
.variables recent ../../settings/recent.txt
|
9
|
+
|
10
|
+
.variables publish ../../settings/publish.txt
|
11
|
+
|
12
|
+
.variables
|
13
|
+
host http://SITE
|
14
|
+
charset utf-8
|
15
|
+
url http://SITE
|
16
|
+
locale en_US
|
17
|
+
|
18
|
+
font.family verdana
|
19
|
+
.end
|
20
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
Initial creation
|
@@ -0,0 +1 @@
|
|
1
|
+
meh
|
@@ -0,0 +1 @@
|
|
1
|
+
meh
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
meh
|
@@ -0,0 +1 @@
|
|
1
|
+
meh
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# 0 = disabled (installed but disabled)
|
2
|
+
# 1 = enabled (implies installed)
|
3
|
+
# x = excluded (not installed; does it even exist?)
|
4
|
+
|
5
|
+
reddit 0 # autopost, embed thread after blog post
|
6
|
+
facebook 0 # reader-like, reader post, autopost?
|
7
|
+
twitter 0 # reader-tweet, reader-follow, autotweet?
|
8
|
+
|
9
|
+
links 1 # widget: external links
|
10
|
+
news 1 # widget: news (external)
|
11
|
+
pages 1 # widget: internal pages
|
12
|
+
pinned 1 # widget: pinned posts
|
13
|
+
|
14
|
+
ad x # widget: embed advertising
|
15
|
+
bydates x # widget: browse posts by date
|
16
|
+
search x # widget: search posts
|
17
|
+
sitemap x # widget: site map
|
18
|
+
tag_cloud x # widget: tag cloud (clickable)
|