5 use Gruta
::Source
::DBI
;
7 use Gruta
::Source
::Mbox
;
8 use Gruta
::Renderer
::Grutatxt
;
9 use Gruta
::Renderer
::HTML
;
10 use Gruta
::Template
::Artemus
;
11 use Gruta
::Template
::TT
;
15 my $base = '/var/www/webon';
17 my $src = Gruta
::Source
::DBI
->new(
18 string
=> "dbi:SQLite:g.db",
23 my $src2 = Gruta
::Source
::FS
->new(
27 my $src3 = Gruta
::Source
::Mbox
->new(
30 topic_name
=> 'Links',
31 index_file
=> '/tmp/url.mbox.idx'
34 my $rndr = Gruta
::Renderer
::Grutatxt
->new();
35 my $rndr2 = Gruta
::Renderer
::HTML
->new();
36 my $rndr3 = Gruta
::Renderer
::HTML
->new( valid_tags
=> undef );
38 my $tmpl = Gruta
::Template
::Artemus
->new(
39 path
=> "./templates/artemus"
42 my $tmpl2 = Gruta
::Template
::TT
->new(
43 path
=> "./templates/tt"
48 # upload => [ "${base}/img" ],
49 # templates => [ "${base}/templates" ],
50 sources
=> [ $src2, $src3 ],
51 renderers
=> [ $rndr, $rndr2, $rndr3 ],
53 cgi
=> Gruta
::CGI
->new()
56 my $ret = $tmpl->process('{-foreach|a1,a2;b1,b2;c1,c2|[-l/STORY/%0/%1]|,}');
58 $w->login('angel', 'test');
61 $w->template->cgi_vars( { t
=> 'LOGIN', topic
=> 'alimentos', userid
=> 'angel', pass
=> 'test' } );
63 #my $str = $w->template->process("{-story_part|alimentos|200609200001|content}");
64 #my $str = $w->template->process("{-loop_topics|_topics_as_option|\n}");
65 #$str = $w->template->process("{-story_loop_by_date|noticias|10|0|_story_link_as_item_with_hits|\n}");
66 #$str = $w->template->process("{-loop_renderers||\n}");
69 my @sbt = $w->search_stories_by_tag('cocina de autor');
71 my $str = $w->template->process('LOGIN');
73 my @ts = $w->topics();
75 my $topic = $w->topic('pruebas');
76 my $topic2 = $w->topic('noticias');
77 my $topic3 = $w->topic('links');
79 $topic->set('editors', 'coco');
82 my $u = $w->user('basurilla');
84 my @ss = $w->stories_by_date( [ 'noticias' ], num
=> 10 );
85 @ss = $w->stories_by_date( '', num
=> 10 );
87 @ss = $w->stories('links');
88 my $story_n = $w->story('links', $ss[0]);
89 my @t = $story_n->tags();
91 my $story = $w->story('alimentos', '200609200001');
92 my @tags = $story->tags();
94 $story = $w->story('art', '200210040002');
95 $story = $w->story('art', '200210040002');
96 $story = $w->story('rec', '200209020002');
97 $v = $story->is_visible($w->auth());
98 $story = $w->story('noticias', 'a60cc163');
99 $v = $story->is_visible($w->auth());
101 $story = $w->story('pruebas', '200707250001');
103 $story = $w->story('tbl', '200202270001');
105 my $hits = $story->get('hits');
106 $story->set('hits', $hits + 1);
109 my $story = Gruta
::Data
::Story
->new( topic_id
=> 'pruebas',
110 title
=> 'Testing', format
=> 'raw_html' );
111 $w->insert_story($story);
113 @ss = $w->search_stories('noticias', 'dieta');
115 #my $data = Gruta::Data->new(
117 # Gruta::Source::DBI->new(
118 # string => "dbi:SQLite:${base}/blabla.db",
125 #my $src2 = Webon::Source::FS->new(
126 # path => "${base}/var"
129 my @l = $w->stories_top_ten(10);