Andrew,

Please check: http://wiki.radiantcms.org/Thirdparty_Extensions for Backdoor and 
other
interesting extensions.

Subscriber extension: 
http://darcs.bigchieflabs.com/radiant/extensions/subscriber/

ifancestor tags : 
# -----------  CODE START
module IfancestorTag
  include Radiant::Taggable
  
        tag "if_ancestor_or_self" do |tag|
                tag.expand if (tag.globals.actual_page.ancestors +
[tag.globals.actual_page]).include?(tag.locals.page)
        end
end
# -----------  CODE END

automated page building and update : I use this to scrape Google News for 
events of interest
(see attached script scrapeGoogleFor) and add this automatically (cron job) to 
the Radiant
based web-pages (see attachment: addNewsPage)

saji

--

* Andrew O'Brien <[EMAIL PROTECTED]> [2007-09-14 10:56:08 -0400]:

> Those extensions sound pretty interesting.  I don't see them on the
> wiki -- are they available anywhere?
> 
> -Andrew
> 
> On 9/14/07, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]> wrote:
> > Dear All,
> >
> > Announcing our new site [beta]
> > (http://210.98.49.34:3000 almost ready to be moved to the
> > regular webserver) proudly made with Radiant!
> >
> > Thanks for all the help in building up this site using Radiant
> > (esp. Extension developers of "Subscriber (Andrea Fanz)", "Backdoor (Aitor)"
> > and "ifancestor" tags from Sean Cribbs, automated page building:
> > Dan Sheppard, Sean Cribbs and Adam Williams)
> >
> > cheers,
> >
> > saji
> >
> > _______________________________________________
> > Radiant mailing list
> > Post:   [email protected]
> > Search: http://radiantcms.org/mailing-list/search/
> > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> >
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

-- 
Saji N. Hameed

APEC Climate Center                                     +82 51 668 7470
National Pension Corporation Busan Building 12F         
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705                 [EMAIL PROTECTED]
KOREA
#!/usr/bin/ruby

require 'rubygems'
require 'mechanize'
require 'open-uri'
require 'hpricot'

if ARGV.length==0
  puts "USAGE  :  scrapeGoogleFor newsitem"
  exit
end

whichNews=ARGV[0]
outFil=ARGV[0]

if whichNews=="storms"
  whichNews="typhoon OR hurricane OR cyclone"
end


rootDir="/home/saji/public_html/Radiant/News_Service/"

agent = WWW::Mechanize.new
puts "Navigating to Google News"
page = agent.get('http://news.google.com/')
google_form = page.form('f')
puts "Submitting search for  #{whichNews}"
google_form.q = "allintitle: #{whichNews}"
page = agent.submit(google_form)

puts "Writing results to temporary file"
tmpfil="#{rootDir}/tmp_news.html"
`rm #{tmpfil}`
tFil=File.new(tmpfil,"a")
tFil.write page.body
tFil.fsync # write all buffered data to disk
sleep(1)

newsfil="#{rootDir}/#{outFil}_news.html"
`rm #{newsfil}`
sFil=File.new(newsfil,"a")

doc = open(tmpfil) { |f| Hpricot f, :xhtml_strict => true }
mainy=(doc/"div.mainbody/table")
(mainy/"[EMAIL PROTECTED]'lh']/a").each do |taby|
  sFil.puts "<p>"
  sFil.puts taby.to_html
  sFil.puts "</p>"
end
#!/usr/bin/ruby /home/saji/public_html/Radiant/script/runner

require '/home/saji/public_html/Radiant/config/environment' 

def createNewsPage(parent,newsPage)
  child = parent.children.create(
  :title => newsPage.capitalize,
  :breadcrumb => newsPage,
  :slug => newsPage,
  :status_id => "100") 
  
 # child.parts.create(
 # :name => "body",
 # :content => ""    )
  child.save!
end

newsPages = %w(floods wildfire drought storms)
newsDir = Page.find_by_url('/services/news')
rootDir="/home/saji/public_html/Radiant/News_Service"

for newsPage in newsPages do

 puts "Refreshing the newspage for #{newsPage}"
 newsEvent= Page.find_by_url("/services/news/#{newsPage}")
  neClass=newsEvent.class
  if neClass==FileNotFoundPage
    createNewsPage(newsDir,newsPage)
  end                                 

  newsEvent= Page.find_by_url("/services/news/#{newsPage}")
  newsFil="#{rootDir}/#{newsPage}_news.html"
  content=File.read(newsFil)
  content.gsub!(/id=\"\S+\"/,'class="modalNews"') # replace id to see contents 
in a ModalBox
  con_arr=content.split("</p>")
  summary=con_arr[0..2].join("</p>")
  summary=summary+"</p>"

  newsEvent.parts.clear
  newsEvent.parts.create(
    :content => content,
    :name => "body")
  newsEvent.parts.create(
    :content => summary,
    :name => "summary")
  newsEvent.update

end
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to