X-Original-To: pgsql-www-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D43A1D1E0FF for ; Thu, 19 Feb 2004 18:03:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 60833-02 for ; Thu, 19 Feb 2004 14:03:20 -0400 (AST) Received: from php.gurugeek.org (unknown [213.174.166.198]) by svr1.postgresql.org (Postfix) with ESMTP id 86334D1E0E9 for ; Thu, 19 Feb 2004 14:03:18 -0400 (AST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by php.gurugeek.org (Postfix) with ESMTP id B25561EEE0A; Thu, 19 Feb 2004 19:03:17 +0100 (CET) In-Reply-To: <20040219173236.81876.qmail@web40007.mail.yahoo.com> References: <20040219173236.81876.qmail@web40007.mail.yahoo.com> Mime-Version: 1.0 (Apple Message framework v609) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: PostgreSQL WWW Mailing List From: David Costa Subject: Re: Feeds Integration Date: Thu, 19 Feb 2004 19:03:16 +0100 To: Chris Ryan X-Mailer: Apple Mail (2.609) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/142 X-Sequence-Number: 3707 On Feb 19, 2004, at 6:32 PM, Chris Ryan wrote: > David, > Hi Chris! ;) > For GBorg specifically the news items are stored on the database. I > forget how it was setup for the main website to access the database > however I can provide a query that would give you the information you > are looking for so you can write a program. Having an RSS feed on GBorg > would be great too. yes I am doing it, and I try to avoid the same str_replace stuff, so db is the way to go. > If you have something I can you to generate the > files that would be great. > well I have it done, will work with any database data in principle. > Here is a query for getting the 10 latest news items for showing on > the main page of GBorg. > > SELECT project_name, > headline, > body, > submit_date -- date not datetime :( > FROM project_news, project > WHERE (project_news.project_id=project.project_id) > AND (project_news.active=true) > AND (project_news.on_homepage=true) > ORDER BY submit_date DESC > LIMIT 10; > > Umh, so what about the link ? is it part of the body ? if that is the case it might be a problem, can solve that, just not the fast way to produce the xml from db data. > I will leave issues of access to the GBorg database up to Marc. I can do it without access to gborg.(In my previous email I was under the impression that you had a separate table for news, but this is obviously not the case) Without db access I can still do the script and add some quick comments to set it up the right way. For now the query is fine, but I need to know where the link is stored, on which row. for example I used something like this for the main news array("title" => $row["title"], "link" => $row["url"], "description" => $row['news'], "author" => $row["author"] , "date" => date("d-M-Y", $row["date"])); see I keep on the beta database the url as a separate entity assigned to the link field in the XML generation. For link I mean the "click here for the full story." thing. Cheers David Costa > > Chris Ryan > > > --- David Costa wrote: >> Hello All, >> I plan to move forward with a gborg and events feed. This as a nice >> addition of the existing one (beta version on dotgeek.org). >> >> Problem, for the beta news, I had to do a separate scripts to fetch >> the >> news because I don't have them in a database, then add these locally >> and fetch them >> for the XML feed. >> >> (how ? >> >> $handle = fopen("http://postgresql.dotgeek.org/", "r"); >> $file_handler = ""; >> while (!feof($handle)) >> $file_handler .= fgets($handle, 4096); >> if (!ereg("(.+)", $file_handler, $news)) >> print "error"; >> $news = str_replace("\n\n> name=\"news\">\n> color=\"#FFFFFF\">News\n\n", "", $news[1]); >> $news = ereg_replace("(\n){3,}", "\n", $news); >> /*print $news; >> print "\n\n\n-------------------------------------------\n\n\n\n";*/ >> $pattern = "> style=\"font-weight: bold; font-size: medium; color: #020169\">"; >> $pattern .= "([^(
\nPosted on ([0-9]+-[0-9]+-[0-9]+) >> by >> ([^("; >> $pattern .= "
\n([^(\n"; >> $rinfo = array(); >> $i = 0; >> etc etc ) >> >> Now, it would be useless to do the same exercise considered that you >> do >> have them in a database. So if I know the db schema, I could possibly >> >> have it to work locally >> or upload on my space on your server (thanks Marc !!) something ready >> >> to go. >> >> Ideally (this would work best for me) can someone move on my server >> space with you the tables Latest News (gborg) and (events) ? With >> these >> I can do a full test on my box and >> upload something ready to go. >> >> For the website integration, I can handle that too but..can I work on >> >> Alexey's beta ? This would allow me to add the feeds links without >> having to download >> the full site with a CVS checkout and upload something which will >> have >> in any case be modified for Alexey's new layout. >> >> Of course if you want to implement the news feeds sooner, I could do >> a >> fresh checkout, upload, add the changes and leave it to you. >> >> Thanks again for your time and attention ;) >> Cheers >> David >> >> >> ---------------------------(end of >> broadcast)--------------------------- >> TIP 9: the planner will ignore your desire to choose an index scan if >> your >> joining column's datatypes do not match > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail SpamGuard - Read only the mail you want. > http://antispam.yahoo.com/tools