infod 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/infod.rb +52 -12
  2. data/infod/{Th/404.rb → 404.rb} +4 -16
  3. data/infod/500.rb +53 -0
  4. data/infod/GET.rb +104 -0
  5. data/infod/HEAD.rb +23 -0
  6. data/infod/HTTP.rb +105 -0
  7. data/infod/{Th/PATCH.rb → PATCH.rb} +0 -0
  8. data/infod/POST.rb +34 -0
  9. data/infod/audio.rb +30 -0
  10. data/infod/blog.rb +34 -0
  11. data/infod/cal.rb +72 -0
  12. data/infod/{Es/code.rb → code.rb} +7 -4
  13. data/infod/constants.rb +55 -0
  14. data/infod/{Es/css.rb → css.rb} +0 -0
  15. data/infod/{Es/csv.rb → csv.rb} +0 -0
  16. data/infod/{Es/du.rb → du.rb} +0 -0
  17. data/infod/edit.rb +73 -0
  18. data/infod/{H/facets.rb → facets.rb} +20 -11
  19. data/infod/{Es/feed.rb → feed.rb} +17 -16
  20. data/infod/{Es/find.rb → find.rb} +2 -3
  21. data/infod/forum.rb +13 -0
  22. data/infod/{Es/fs.rb → fs.rb} +5 -2
  23. data/infod/glob.rb +26 -0
  24. data/infod/graph.rb +123 -0
  25. data/infod/{Es/grep.rb → grep.rb} +2 -2
  26. data/infod/{Es/groonga.rb → groonga.rb} +41 -33
  27. data/infod/{H/histogram.rb → histogram.rb} +23 -16
  28. data/infod/html.rb +231 -0
  29. data/infod/{Es/image.rb → image.rb} +16 -26
  30. data/infod/{Es/index.rb → index.rb} +38 -25
  31. data/infod/infod.rb +52 -12
  32. data/infod/json.rb +38 -0
  33. data/infod/{Es/kv.rb → kv.rb} +3 -9
  34. data/infod/{Y.rb → lambda.rb} +18 -1
  35. data/infod/ls.rb +49 -0
  36. data/infod/mail.rb +90 -0
  37. data/infod/{Es/man.rb → man.rb} +3 -15
  38. data/infod/{H/microblog.rb → microblog.rb} +22 -31
  39. data/infod/{K.rb → mime.rb} +68 -52
  40. data/infod/{N.rb → names.rb} +78 -45
  41. data/infod/page.rb +13 -0
  42. data/infod/postscript.rb +26 -0
  43. data/infod/rdf.rb +51 -0
  44. data/infod/{Rb.rb → ruby.rb} +18 -33
  45. data/infod/{Es/schema.rb → schema.rb} +22 -7
  46. data/infod/{Es/search.rb → search.rb} +5 -11
  47. data/infod/{Es/sh.rb → sh.rb} +0 -0
  48. data/infod/{Es/text.rb → text.rb} +33 -29
  49. data/infod/{H/threads.rb → threads.rb} +17 -27
  50. data/infod/{H/time.rb → time.rb} +14 -34
  51. data/infod/{H/who.rb → whois.rb} +6 -4
  52. data/infod/{H/wiki.rb → wiki.rb} +0 -0
  53. metadata +54 -64
  54. data/config.ru +0 -3
  55. data/infod/Es.rb +0 -31
  56. data/infod/Es/filter.rb +0 -75
  57. data/infod/Es/glob.rb +0 -22
  58. data/infod/Es/html.rb +0 -271
  59. data/infod/Es/in.rb +0 -68
  60. data/infod/Es/json.rb +0 -68
  61. data/infod/Es/ls.rb +0 -58
  62. data/infod/Es/mail.rb +0 -87
  63. data/infod/Es/mime.rb +0 -59
  64. data/infod/Es/out.rb +0 -52
  65. data/infod/Es/pager.rb +0 -34
  66. data/infod/Es/pdf.rb +0 -19
  67. data/infod/Es/rdf.rb +0 -35
  68. data/infod/H.rb +0 -15
  69. data/infod/H/audio.rb +0 -19
  70. data/infod/H/blog.rb +0 -15
  71. data/infod/H/cal.rb +0 -81
  72. data/infod/H/edit.rb +0 -88
  73. data/infod/H/forum.rb +0 -4
  74. data/infod/H/hf.rb +0 -114
  75. data/infod/H/mail.rb +0 -92
  76. data/infod/Th.rb +0 -36
  77. data/infod/Th/500.rb +0 -41
  78. data/infod/Th/GET.rb +0 -62
  79. data/infod/Th/HEAD.rb +0 -5
  80. data/infod/Th/POST.rb +0 -39
  81. data/infod/Th/perf.rb +0 -37
  82. data/infod/Th/uid.rb +0 -24
  83. data/infod/Th/util.rb +0 -89
data/infod/blog.rb ADDED
@@ -0,0 +1,34 @@
1
+ #watch __FILE__
2
+ class E
3
+
4
+ F['view/'+SIOCt+'BlogPost']=->g,e{
5
+
6
+ F['example/blogview'][g,e]
7
+
8
+ }
9
+
10
+ F['example/blogview']=->g,e{
11
+ g.map{|u,r|
12
+ case u
13
+ when /artery.wbur/ # compact whitespace a bit
14
+ r[Content] = {class: :WBUR, c: [{_: :style, c: ".WBUR p {margin:0}"},r[Content]]}
15
+ F['view/base'][{u => r},e,false]
16
+ when /boston\.com/ # crop sharebuttons
17
+ (Nokogiri::HTML.parse r[Content][0]).css('p')[0].do{|p|r[Content]=p.inner_html}
18
+ F['view/base'][{u => r},e,false]
19
+ when /flickr/
20
+ r[Content]
21
+ when /reddit/ # minimal view
22
+ F['view/'+SIOCt+'BoardPost'][{u => r},e]
23
+ when /universalhub/ # logo + trim spacehogging tagjunk
24
+ c = Nokogiri::HTML.parse r[Content][0]
25
+ c.css('section').map{|x|x.remove}
26
+ {c: [{_: :a, href: r['http://purl.org/rss/1.0/link'][0].E.uri,
27
+ c: [{_: :img, src: '/logos/uhub.png',style: 'position:absolute;top:-93px'},
28
+ {_: :h2, style: 'color:#000;margin:0',c: r[Title]}]},c.to_s],
29
+ style: 'float:left;max-width:40em;position:relative;background-color:#fff;border-color:#eee;margin-top:93px;margin-right:.3em;padding-top:0;border-style:dotted;border-width:.3em;border-radius:0 .8em .8em .8em'}
30
+ else
31
+ F['view/base'][{u => r},e,false]
32
+ end}}
33
+
34
+ end
data/infod/cal.rb ADDED
@@ -0,0 +1,72 @@
1
+ #watch __FILE__
2
+ class E
3
+
4
+ fn 'req/day',->e,r{
5
+ [303, {'Location'=> e.day.uri + r.q.except('y').qs}, []]}
6
+
7
+ def day; as Time.now.strftime '%Y/%m/%d/' end
8
+
9
+ fn 'table/month',->d{ m={}
10
+ d.map{|u,r|
11
+ r[Date].do{|d|d[0].do{|t|
12
+ t = Time.parse t unless t.time?
13
+ o=12*t.year + t.month - 1
14
+ x=o/3
15
+ y=o%3
16
+ m[x] ||= {}
17
+ m[x][y] ||= {}
18
+ m[x][y][u] = r
19
+ m[x][y][:time] = t
20
+ }} if r.class==Hash }
21
+ m }
22
+
23
+ fn 'table/day',->d{ m={}
24
+ d.map{|u,r|
25
+ r[Date].do{|d|d[0].do{|t|
26
+ t = DateTime.parse t unless t.time?
27
+ w=t.strftime('%Y%W').to_i
28
+ d=t.cwday
29
+ m[w] ||= {}
30
+ m[w][d] ||= {}
31
+ m[w][d][u] = r
32
+ m[w][d][:time] = t
33
+ }} if r.class==Hash }
34
+ m }
35
+
36
+ fn 'table/hour',->d{ m={}
37
+ d.map{|u,r|
38
+ r[Date].do{|d|d[0].do{|t|
39
+ t = Time.parse t unless t.time?
40
+ h=t.hour
41
+ s=h/12
42
+ h12=h%12
43
+ m[h12] ||= {}
44
+ m[h12][s] ||= {}
45
+ m[h12][s][u] = r
46
+ m[h12][s][:time] = t
47
+ }} if r.class==Hash }
48
+ m }
49
+
50
+ fn 'view/year',->d,e{F['view/t'][d,e,'month','month']}
51
+
52
+ fn 'view/month',->d,e{
53
+ [(d.delete :time).do{|month|
54
+ {_: :b, c: month.strftime('%B'),style: "color: #{E.cs}"}},
55
+ F['view/t'][d,e,'day','day-terminate']]}
56
+
57
+ fn 'view/day-terminate',->d,e{
58
+ [(d.delete :time).do{|day|
59
+ {_: :b, c: day.strftime('%d'),style: "float:left; color: #888"}},
60
+ F['view/title'][d,e]]}
61
+
62
+ fn 'view/day',->d,e{
63
+ [(d.delete :time).do{|day|
64
+ {_: :b, c: day.strftime('%d'),style: "float:left; color: #888"}},
65
+ F['view/t'][d,e,'hour','hour']]}
66
+
67
+ fn 'view/hour',->d,e{
68
+ [(d.delete :time).do{|hour|
69
+ {_: :b, c: hour.strftime('%H'),style: "float:left"}},
70
+ F['view/title'][d,e]]}
71
+
72
+ end
@@ -3,10 +3,9 @@ class E
3
3
  def triplrSourceCode
4
4
  m = mime.split(/\//)[-1].sub(/^x-/,'')
5
5
  # show line numbers?
6
- n = @r.has_key?('n') && "--line-number-ref=#{uri.sh}"
6
+ n = (@r && @r.q.has_key?('n')) ? "--line-number-ref=#{uri.sh}:" : ""
7
7
  if size < 512e3
8
- yield uri,Content,
9
- `source-highlight -f html -o STDOUT -i #{sh} -s #{m} #{n}`
8
+ yield uri,Content, `source-highlight -f html -s #{m} #{n} -i #{sh} -o STDOUT`
10
9
  end
11
10
  end
12
11
 
@@ -15,7 +14,11 @@ class E
15
14
  r[Content]]}]}
16
15
 
17
16
  # ls /usr/share/source-highlight/*.lang | xargs -i basename {} .lang | tr "\n" " "
18
- %w{ada applescript asm awk bat bib bison caml changelog c clipper cobol conf cpp csharp css desktop diff d erlang errors flex fortran function glsl haskell haskell_literate haxe html html_simple java javascript key_string langdef latex ldap lisp log logtalk lsm lua m4 makefile manifest nohilite number outlang oz pascal pc perl php postscript prolog properties proto python ruby scala script_comment sh shellscript slang sml spec sql style symbols tcl texinfo todo url vala vbscript xml}
17
+ %w{ada applescript asm awk bat bib bison caml changelog c clipper cobol conf cpp csharp css
18
+ desktop diff d erlang errors flex fortran function glsl haskell haskell_literate haxe html java
19
+ javascript key_string langdef latex ldap lisp log logtalk lsm lua m4 makefile manifest nohilite
20
+ number outlang oz pascal pc perl php prolog properties proto python ruby scala sh
21
+ shellscript slang sml spec sql style symbols tcl texinfo todo url vala vbscript xml}
19
22
  .map{|l|
20
23
  ma = 'application/' + l
21
24
  mt = 'text/x-' + l
@@ -0,0 +1,55 @@
1
+ class E
2
+
3
+ FSbase = `pwd`.chomp ; BaseLen = FSbase.size
4
+ URIURL = '/@' # non-HTTP URI path resolution-prefix
5
+ S = /\._/ # data path-separator
6
+
7
+ W3 = 'http://www.w3.org/'
8
+ Purl = 'http://purl.org/'
9
+ FOAF = "http://xmlns.com/foaf/0.1/"
10
+ SIOC = 'http://rdfs.org/sioc/ns#'
11
+ SIOCt = 'http://rdfs.org/sioc/types#'
12
+ MIMEtype = 'http://www.iana.org/assignments/media-types/'
13
+ DIG = 'http://dig.csail.mit.edu/'
14
+ Deri = 'http://vocab.deri.ie/'
15
+ DC = Purl + 'dc/terms/'
16
+ Date = DC + 'date'
17
+ Title = DC + 'title'
18
+ Name = FOAF + 'name'
19
+ To = SIOC + 'addressed_to'
20
+ Creator = SIOC + 'has_creator'
21
+ Content = SIOC + 'content'
22
+ XHV = W3 + '1999/xhtml/vocab#'
23
+ RDFns = W3 + "1999/02/22-rdf-syntax-ns#"
24
+ EXIF = W3 + '2003/12/exif/ns#'
25
+ WF = W3 + '2005/01/wf/flow#'
26
+ HTTP = W3 + '2011/http#'
27
+ Header = W3 + '2011/http-headers#'
28
+ LDP = W3 + 'ns/ldp#'
29
+ Next = LDP+'nextPage'
30
+ Prev = LDP+'prevPage'
31
+ Posix = W3 + 'ns/posix/'
32
+ Type = RDFns+ "type"
33
+ # Type = W3 + "ns/rdf#type"
34
+ RDFs = W3 + 'ns/rdfs#'
35
+ PAC = DIG + '2008/PAC/ontology/pac#'
36
+ COGS = Deri + 'cogs#'
37
+ CSV = Deri + 'scsv#'
38
+ HTML = RDFns + "HTML"
39
+ Label = RDFs + 'label'
40
+ Stat = Posix + 'stat#'
41
+ Search = 'http://sindice.com/vocab/search#'
42
+ Audio = 'http://www.semanticdesktop.org/ontologies/nid3/#'
43
+ Edit = 'http://buzzword.org.uk/rdf/personal-link-types#edit'
44
+ Render = 'http://whats-your.name/www#RenderMIME/'
45
+
46
+ Prefix={
47
+ "dc" => DC,
48
+ "foaf" => FOAF,
49
+ "rdf" => W3 + "ns/rdf#" ,
50
+ "rdfs" => RDFs,
51
+ "sioc" => SIOC,
52
+ "stat" => Stat,
53
+ }
54
+
55
+ end
File without changes
File without changes
File without changes
data/infod/edit.rb ADDED
@@ -0,0 +1,73 @@
1
+ #watch __FILE__
2
+ class E
3
+
4
+ Prototypes = {
5
+ SIOCt+'MicroblogPost' => [Content],
6
+ SIOCt+'BlogPost' => [Date, Title, Content], nil=>nil,
7
+ 'blank'=>[]
8
+ }
9
+
10
+ F['protograph/editable'] = F['protograph/_']
11
+
12
+ fn 'graph/editable',->e,env,g{
13
+ e.fromStream g, :triplrFsStore}
14
+
15
+ # select a prototype graph
16
+ # , or go blank
17
+ fn 'view/create',->g,e{
18
+ [H.css('/css/create'),{_: :b, c: :create},
19
+ Prototypes.map{|s,_| s.nil? ? {_: :b, c: '&nbsp;'} : {_: :a, href: e['REQUEST_PATH']+'?graph=edit&prototype='+(CGI.escape s), c: s.label}}]}
20
+
21
+ fn 'view/edit',->g,e{
22
+ triple = ->s,p,o{
23
+ if s && p && o
24
+ s = s.E
25
+ p = p.E
26
+ oE = p.literal o
27
+ (id = s.concatURI(p).concatURI oE
28
+ [(case p
29
+ when Content
30
+ {_: :textarea, name: id, c: o, rows: 24, cols: 80}
31
+ when Date
32
+ {_: :input, name: id, type: :datetime, value: o.empty? ? Time.now.iso8601 : o}
33
+ else
34
+ {_: :input, name: id, value: o, size: 54}
35
+ end
36
+ ),"<br>\n"]) if oE
37
+ end}
38
+
39
+ ps = []
40
+ e.q['prototype'].do{|pr| Prototypes[pr].do{|v|
41
+ g[e['uri']+'#'] ||= {}
42
+ ps.concat v }}
43
+ e.q['p'].do{|p| ps.push p }
44
+
45
+ [(H.once e, 'edit', (H.css '/css/edit')),
46
+ {_: :form, name: :editor, method: :POST, action: e['REQUEST_PATH'],
47
+
48
+ # each resource
49
+ c: [ g.map{|s,r|
50
+ url = s.E.localURL e
51
+ # per-resource links
52
+ {class: :resource, c:
53
+ [{_: :a, class: :uri, id: s, c: s, href: url},
54
+ {_: :a, class: :edit, c: '+predicate', href: url+'?graph=_&view=addP'},'<br><br>',
55
+
56
+ # each property
57
+ # r.keys.concat(ps).uniq.-(['uri']).map{|p|
58
+ (r.keys.concat(ps).uniq.map{|p|
59
+ [{_: :b, c: p}, '<br>',
60
+ r[p].do{|o| [*o].map{|o|triple[s,p,o]}}, # existing triples
61
+ triple[e['uri'],p,''], '<br>']} if r.class==Hash)]} if s.match(/#/)}, # create triple
62
+ {_: :input, type: :submit, value: 'save'}]}]}
63
+
64
+ # select a property to edit
65
+ fn 'view/addP',->g,e{
66
+ [(H.once e, 'edit', (H.css '/css/edit')),
67
+ [Date,Title,Creator,Content,Label].map{|p|{_: :a, href: p, c: p.label+' '}},
68
+
69
+ {_: :form, action: e['REQUEST_PATH'], method: :GET,
70
+ c: [{_: :input, type: :url, name: :p, pattern: '^http.*$', size: 64},
71
+ {_: :input, type: :submit, value: 'property'}]}]}
72
+
73
+ end
@@ -1,7 +1,16 @@
1
1
  #watch __FILE__
2
2
  class E
3
+ =begin
4
+ faceted-filter, implemented via dynamically-generated style-sheets
3
5
 
4
- fn 'view/facets/main',->a,m,e{
6
+ user defines 'itemview/name' which is wrapped by tagged DOM nodes
7
+ structure conformed to in microblog & timegraph (time.rb) views
8
+
9
+ ?view=facets will prompt on which properties (predicates) to use
10
+
11
+ =end
12
+
13
+ fn 'facets',->a,m,e{
5
14
  # facets
6
15
  a = Hash[(a.split ',').map{|a|[a,{}]}]
7
16
 
@@ -17,7 +26,7 @@ class E
17
26
  n=->o{
18
27
  i[o]||='f'+(c+=1).to_s}
19
28
 
20
- view=F['view/'+ (e.q['fv'] || 'divine') + '/resource']
29
+ view = e.q['fv'].do{|fv| F['itemview/'+fv] } || F['itemview/title']
21
30
  resources=->{
22
31
  m.map{|u,r| # each resource
23
32
  a.map{|p,_| # each facet
@@ -33,27 +42,27 @@ class E
33
42
  [(H.css'/css/facets'),(H.js'/js/facets'),(H.js'/js/mu'),
34
43
 
35
44
  a.map{|b,_|{_: :style, class: n[b]}},
45
+ '&nbsp;' * 22,
46
+ a.map{|f,v|{class: :selector, facet: n[f], c: f.label}},
36
47
 
37
48
  # facet selection
38
49
  {class: :sidebar, c: a.map{|f,v|
39
- {class: :facet, title: f, facet: n[f], # predicate
40
- c: [f.label,
50
+ {class: :facet, facet: n[f], # predicate
51
+ c: [{class: :predicate, c: f.label},
41
52
  v.sort_by{|k,v|v}.reverse.map{|k,v| # sort by popularity
42
53
  k.respond_to?(:label) &&
43
54
  {facet: n.(k.to_s), # predicate-object tuple
44
55
  c: [{_: :span, class: :count, c: v},
45
- {_: :span, class: :name, c: k.label}]}}]}}},
46
-
47
- (F['view/'+e.q['fv']+'/base']||
48
- ->m,e,r{r.()}).(m,e,resources)]}
56
+ {_: :span, class: :name, c: k.label}]}}]}}},
57
+ (e.q['fv'].do{|fv|F['baseview/'+fv]} || ->m,e,r{r.()}).(m,e,resources)]}
49
58
 
50
- fn 'view/facets/select',->m,e{
59
+ fn 'view/facetSelect',->m,e{
51
60
  [(H.js '/js/facets.select'),(H.js '/js/mu'),(H.css '/css/facets'),
52
61
  E.graphProperties(m).map{|e|[{c: e},' ']},
53
62
  {_: 'button', c: 'Go'}]}
54
63
 
55
64
  fn 'view/facets',->m,e{
56
- e.q['a'].do{|a|Fn 'view/facets/main',a,m,e} ||
57
- (Fn 'view/facets/select',m,e)}
65
+ e.q['a'].do{|a|Fn 'facets',a,m,e} ||
66
+ (Fn 'view/facetSelect',m,e)}
58
67
 
59
68
  end
@@ -1,5 +1,7 @@
1
1
  #watch __FILE__
2
+
2
3
  module FeedParse
4
+
3
5
  def html; CGI.unescapeHTML self end
4
6
  def cdata; sub /^\s*<\!\[CDATA\[(.*?)\]\]>\s*$/m,'\1'end
5
7
  def guess; send (case self
@@ -11,21 +13,20 @@ module FeedParse
11
13
  :html
12
14
  end) end
13
15
 
14
- def parse # Universal feed-parser
16
+ def parse
15
17
 
16
- #xml qname table
18
+ #prefix table
17
19
  x={}
18
20
  match(/<(rdf|rss|feed)([^>]+)/i)[2].scan(/xmlns:?([a-z]+)?=["']?([^'">\s]+)/){|m|x[m[0]]=m[1]}
19
21
 
20
22
  #items
21
23
  scan(%r{<(rss:|atom:)?(item|entry)([\s][^>]*)?>(.*?)</\1?\2>}mi){|m|
22
24
 
23
- # TODO (gu)id field is often unresolvable. maybe use link[rel=alternate] as identifier instead since it's resolvable & HTTP
24
-
25
- # find identifier
25
+ # identifier select -> RDF URI || <id> || <link>
26
26
  u = m[2] && (u = m[2].match /about=["']?([^'">\s]+)/) && u[1] ||
27
27
  m[3] && (((u = m[3].match /<(gu)?id[^>]*>([^<]+)/) || (u = m[3].match /<(link)>([^<]+)/)) && u[2])
28
28
 
29
+ yield u, E::Type, (E::SIOCt+'BlogPost').E
29
30
  yield u, E::Type, (E::SIOC+'Post').E
30
31
 
31
32
  #links
@@ -37,7 +38,9 @@ module FeedParse
37
38
  m[3].scan(%r{<([a-z]+:)?([a-z]+)([\s][^>]*)?>(.*?)</\1?\2>}mi){|e|
38
39
  yield u, # s
39
40
  (x[e[0]&&e[0].chop]||E::RSS)+e[1], # p
40
- e[3].extend(FeedParse).guess}} # o
41
+ e[3].extend(FeedParse).guess.do{|o|# o
42
+ o.match(/\A(\/|http)[\S]+\Z/) ? o.E : o
43
+ }}}
41
44
 
42
45
  nil
43
46
  end
@@ -53,13 +56,11 @@ class E
53
56
  def listFeeds; (nokogiri.css 'link[rel=alternate]').map{|u|E (URI uri).merge(u.attr :href)} end
54
57
  alias_method :feeds, :listFeeds
55
58
 
56
- def getFeed g; addJSON :triplrFeed,g end
57
- def getFeedReddit g; addJSON :triplrFeedReddit,g end
59
+ def getFeed g; insertDocs :triplrFeed, g end
60
+ def getFeedReddit g; insertDocs :triplrFeedReddit, g end
58
61
 
59
- # tripleStream
60
62
  def triplrFeed &f
61
- dateNorm :triplrFeedSIOCize,:triplrFeedRaw,&f
62
- rescue Exception => x
63
+ dateNorm :contentURIresolve,:triplrFeedNormalize,:triplrFeedRaw,&f
63
64
  end
64
65
 
65
66
  def triplrFeedReddit &f
@@ -68,16 +69,17 @@ class E
68
69
  Nokogiri::HTML.parse(o).do{|o|
69
70
  o.css('.md').do{|o|yield s,p,o}
70
71
  yield s,Creator,o.css('a')[-4].child.to_s.strip
72
+ yield s,Type,(SIOCt+'BoardPost').E
71
73
  } : (yield s,p,o)}
72
74
  end
73
75
 
74
- # tripleStream
75
76
  def triplrFeedRaw &f
76
- read.extend(FeedParse).parse &f
77
+ read.to_utf8.extend(FeedParse).parse &f
78
+ rescue Exception => e
79
+ puts [uri,e,e.backtrace[0]].join ' '
77
80
  end
78
81
 
79
- # tripleStream -> tripleStream
80
- def triplrFeedSIOCize *f
82
+ def triplrFeedNormalize *f
81
83
  send(*f){|s,p,o|
82
84
  yield s,
83
85
  { Purl+'dc/elements/1.1/creator' => Creator,
@@ -92,7 +94,6 @@ class E
92
94
  }[p]||p,
93
95
  o } end
94
96
 
95
-
96
97
  fn Render+'application/atom+xml',->d,e{
97
98
  id = 'http://' + e['SERVER_NAME'] + (CGI.escapeHTML e['REQUEST_URI'])
98
99
  H(['<?xml version="1.0" encoding="utf-8"?>',
@@ -4,8 +4,8 @@ class E
4
4
  fn 'set/find',->e,q,m,x=''{
5
5
  q['q'].do{|q|
6
6
  r = '-iregex ' + ('.*' + q + '.*' + x).sh
7
- s = q['size'].do{|s| s.match(/^\d+$/) && '-size +' + s + 'M'}
8
- t = q['day'].do{|d| d.match(/^\d+$/) && '-ctime -' + d }
7
+ s = q['size'].do{|s| s.match(/^\d+$/) && '-size +' + s + 'M'} || ""
8
+ t = q['day'].do{|d| d.match(/^\d+$/) && '-ctime -' + d } || ""
9
9
  [e,e.pathSegment].compact.select(&:e).map{|e|
10
10
  `find #{e.sh} #{t} #{s} #{r} | head -n 1000`.
11
11
  lines.map{|l|l.chomp.unpathFs}}.compact.flatten}}
@@ -13,7 +13,6 @@ class E
13
13
  fn 'view/find',->i,e{
14
14
  {_: :form, method: :GET, action: e['REQUEST_PATH'].t,
15
15
  c: [{_: :input, name: :set, value: :find, type: :hidden},
16
- {_: :input, name: :triplr, value: :id, type: :hidden},
17
16
  {_: :input, name: :view, value: :ls, type: :hidden},
18
17
  {_: :input, name: :q, style: 'float: left;font-size:1.3em'}]}}
19
18
 
data/infod/forum.rb ADDED
@@ -0,0 +1,13 @@
1
+ class E
2
+
3
+ =begin
4
+
5
+ http://rdfs.org/sioc/ns#Forum
6
+ http://rdfs.org/sioc/ns#num_replies
7
+
8
+ http://rdfs.org/sioc/types#MessageBoard
9
+
10
+ =end
11
+
12
+
13
+ end