Index: openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl 12 Jul 2018 09:05:41 -0000 1.3 +++ openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl 2 Apr 2019 10:54:02 -0000 1.4 @@ -1,6 +1,6 @@ ad_library { Procs to manage aggregators. - + @author Simon Carstensen (simon@bcuni.net) @author Guan Yang (guan@unicast.org) @creation-date 2003-07-09 @@ -29,7 +29,7 @@ set user_id [ad_conn user_id] } if { $ip eq ""} { - set ip [ns_conn peeraddr] + set ip [ns_conn peeraddr] } set weblog_id [db_string new_weblog {}] @@ -44,7 +44,7 @@ -base_url:required } { Edit weblog. - + @author Simon Carstensen (simon@bcuni.net) @creation-date 2003-07-14 } { @@ -57,10 +57,10 @@ } { Attempt to validate the specified base URL against the specified blog type. - + @author Guan Yang (guan@unicast.org) @creation-date 2003-12-15 - + @return 1 if the base URL successfully validates, or 0 if it does not appear to be valid, or if the blog type could not be found. @@ -75,24 +75,24 @@ Validates a Movable Type base URL. } { set valid_p 1 - + if { ![util_url_valid_p $base_url] } { # Not a valid URL at all return 0 } - + # MT base urls will start with http or https if { ![regexp {^https?://} $base_url] } { return 0 } - + # At some point we expect to see "app?" or "mt.cgi?" # Is this too strict? if { ![regexp {/app\?__mode=[a-z]+&blog_id=(\d+)} $base_url match blog_id] && ![regexp {/mt.cgi\?__mode=[a-z]+&blog_id=(\d+)} $base_url match blog_id] } { return 0 } - + return 1 } @@ -104,20 +104,20 @@ } { Returns the post URL for a Movable Type weblog. Will barf bigtime if the URL is not valid. - + @author Guan Yang (guan@unicast.org) @creation-date 2003-12-15 } { if { ![news_aggregator::weblog::impl::movabletype_validate_url \ -base_url $base_url] } { return "" } - + if { [regexp {^(.+/app\?)__mode=[a-z]+&blog_id=(\d+)} $base_url match first_part blog_id] || [regexp {^(.+/mt.cgi\?)__mode=[a-z]+&blog_id=(\d+)} $base_url match first_part blog_id] } { # do nothing } - + set post_url $first_part append post_url [export_vars -url [list \ [list "is_bm" 1] \ @@ -129,7 +129,7 @@ [list "link_href" $link] \ [list "text" $text]]] - + return $post_url } @@ -148,10 +148,10 @@ @creation-date 2003-12-15 } { return [news_aggregator::weblog::impl::${blog_type}_get_post_url \ - -base_url $base_url \ - -title $title \ - -link $link \ - -text $text] + -base_url $base_url \ + -title $title \ + -link $link \ + -text $text] } ad_proc -public news_aggregator::weblog::options { @@ -171,11 +171,16 @@ } { return { {"Select Blog Type" {}} - {"Blogger" blogger} - {"Manila" manila} + {"Blogger" blogger} + {"Manila" manila} {"Movable Type" movabletype} {"Radio Userland" radio} {"TypePad" typepad} } } +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: