Go to Post FIRST should come with a warning label. - Tim Sharp [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > CD Forum Support
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2004, 22:16
Robby's Avatar
Robby Robby is offline
Registered User
AKA: Kevin Beranek
FRC #0269 (Cooney Robotics)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Wisconsin
Posts: 47
Robby has a spectacular aura aboutRobby has a spectacular aura about
CD Feed

I was looking through the php script found in the nrg.chaosnet.org repository and was trying to figure out how to access the thread id value so that i could create a link to that specific thread using the url chiefdelphi.com/forums/showthread.php?t=[the desired thread #]. Is this possible? or is there some other way of doing it?
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2004, 22:23
Jeremy_Mc's Avatar
Jeremy_Mc Jeremy_Mc is offline
GitHubber
no team
Team Role: Mentor
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Orlando, FL
Posts: 496
Jeremy_Mc will become famous soon enoughJeremy_Mc will become famous soon enough
Re: CD Feed

Quote:
Originally Posted by Robby
I was looking through the php script found in the nrg.chaosnet.org repository and was trying to figure out how to access the thread id value so that i could create a link to that specific thread using the url chiefdelphi.com/forums/showthread.php?t=[the desired thread #]. Is this possible? or is there some other way of doing it?
You would have to use an RSS parser I think...

I have one made up that's going on our new site...if anyone would like, I can post it in the White Papers.

It's really just a modded version of what Brandon had up here before i beileve...I'd have to look again.
__________________
GitHub - Collaborate on code, documentation, etc. - http://github.com
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2004, 22:58
Brandon Martus's Avatar Unsung FIRST Hero
Brandon Martus Brandon Martus is offline
busy.
AKA: B. Slash Kamen
no team
 
Join Date: May 2001
Rookie Year: 1998
Location: Nevada, TX USA
Posts: 5,271
Brandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond repute
Send a message via ICQ to Brandon Martus Send a message via AIM to Brandon Martus Send a message via Yahoo to Brandon Martus
Re: CD Feed

You want the threadid via the XML? .. or you want to get it just by browsing?

Quote:
Originally Posted by Robby
I was looking through the php script found in the nrg.chaosnet.org repository and was trying to figure out how to access the thread id value so that i could create a link to that specific thread using the url chiefdelphi.com/forums/showthread.php?t=[the desired thread #]. Is this possible? or is there some other way of doing it?
__________________
Brandon Martus
e-mail
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2004, 02:14
Guest
 
Posts: n/a
Re: CD Feed

Here's some new code that links to the correct CD thread.

Unfortunately, the external.xml that CD provides only gives the thread's author, not the post's author. I hope this changed soon

You can see the following code in action at: http://nrg.chaosnet.org/resource/pro...eed/cdfeed.php

The code is also stored in the repository, as usual...
PHP Code:
<?php 
// If you want to use this PHP code, provide credit to [removed]
$cdfeed "[url="http://www.chiefdelphi.com/forums/external.php?type=XML"]http://www.chiefdelphi.com/forums/external.php?type=XML[/url]"; 
$fp fopen($cdfeed"r") or die("<b>Unable read ChiefDelphi feed!</b>\n"); 
while(!
feof($fp)) 
    { 
    
$xmld $xmld.fgets($fp1024); 
    } 
$open_stack = array(); 
$atts_stack = array(); 
$parser xml_parser_create(); 
xml_set_element_handler($parser"start_handler""end_handler"); 
xml_set_character_data_handler($parser"character_handler"); 
xml_parser_set_option($parserXML_OPTION_CASE_FOLDING,0); 
xml_parse($parser$xmld); 
xml_parser_free($parser); 
function 
start_handler($p$name$atts
    { 
    global 
$open_stack
        global 
$atts_stack
    global 
$cdthreads;
    
$open_stack[] = array($name,"",$atts); 
        if (
$name == "thread"){ 
               
$cdthreads[]=array("id"=>$atts['id'],"title"=>"","auth"=>"","time"=>0,"date"=>0);
               
$id=$atts['id'];
               print 
"<a href=\"<A href="http://www.chiefdelphi.com/forums/showthread.php?t=$id\">n">http://www.chiefdelphi.com/forums/showthread.php?t=$id\">\n"; 
        

    } 
function 
character_handler($p$txt
    { 
    global 
$open_stack
    
$cur_index count($open_stack)-1
    
$open_stack[$cur_index][1].=$txt
    } 
function 
end_handler($p$name
    { 
    global 
$open_stack
    
$el array_pop($open_stack); 
        if (
$name == "thread"){ 
               print 
"</a>\n"
        } 
    if (
$name == "title"
        { 
        echo 
"<b>$el[1]</b><br>"
         
$cdthreads[count($cdthreads)-1]['title']=$el[1];
        } 
    if (
$name == "author"
        { 
        echo 
"By <i>$el[1]</i>"
         
$cdthreads[count($cdthreads)-1]['auth']=$el[1];
        } 
    if (
$name == "date"
        { 
        echo 
"On $el[1],"
         
$cdthreads[count($cdthreads)-1]['date']=$el[1];
        } 
    if (
$name == "time"
        { 
        echo 
" at $el[1]<p>"
         
$cdthreads[count($cdthreads)-1]['time']=$el[1];
        } 

    } 
// At this point, all the threads have been printed out if PRINTOUT equaled one
// Also all the threads are stored in $cdthreads associative array.

?>

Last edited by Brandon Martus : 02-08-2016 at 08:18.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2004, 08:35
Robby's Avatar
Robby Robby is offline
Registered User
AKA: Kevin Beranek
FRC #0269 (Cooney Robotics)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Wisconsin
Posts: 47
Robby has a spectacular aura aboutRobby has a spectacular aura about
Re: CD Feed

Thank you, this is pretty much what I was looking for.

Quote:
Originally Posted by SilverStar
Here's some new code that links to the correct CD thread.

Unfortunately, the external.xml that CD provides only gives the thread's author, not the post's author. I hope this changed soon

You can see the following code in action at: http://nrg.chaosnet.org/resource/pro...eed/cdfeed.php

The code is also stored in the repository, as usual...
PHP Code:
<?php 
// If you want to use this PHP code, provide credit to [removed]
$cdfeed "[url="http://www.chiefdelphi.com/forums/external.php?type=XML"]http://www.chiefdelphi.com/forums/external.php?type=XML[/url]"; 
$fp fopen($cdfeed"r") or die("<b>Unable read ChiefDelphi feed!</b>\n"); 
while(!
feof($fp)) 
    { 
    
$xmld $xmld.fgets($fp1024); 
    } 
$open_stack = array(); 
$atts_stack = array(); 
$parser xml_parser_create(); 
xml_set_element_handler($parser"start_handler""end_handler"); 
xml_set_character_data_handler($parser"character_handler"); 
xml_parser_set_option($parserXML_OPTION_CASE_FOLDING,0); 
xml_parse($parser$xmld); 
xml_parser_free($parser); 
function 
start_handler($p$name$atts
    { 
    global 
$open_stack
        global 
$atts_stack
    global 
$cdthreads;
    
$open_stack[] = array($name,"",$atts); 
        if (
$name == "thread"){ 
               
$cdthreads[]=array("id"=>$atts['id'],"title"=>"","auth"=>"","time"=>0,"date"=>0);
               
$id=$atts['id'];
               print 
"<a href=\"<A href="http://www.chiefdelphi.com/forums/showthread.php?t=$id\">n">http://www.chiefdelphi.com/forums/showthread.php?t=$id\">\n"; 
        

    } 
function 
character_handler($p$txt
    { 
    global 
$open_stack
    
$cur_index count($open_stack)-1
    
$open_stack[$cur_index][1].=$txt
    } 
function 
end_handler($p$name
    { 
    global 
$open_stack
    
$el array_pop($open_stack); 
        if (
$name == "thread"){ 
               print 
"</a>\n"
        } 
    if (
$name == "title"
        { 
        echo 
"<b>$el[1]</b><br>"
         
$cdthreads[count($cdthreads)-1]['title']=$el[1];
        } 
    if (
$name == "author"
        { 
        echo 
"By <i>$el[1]</i>"
         
$cdthreads[count($cdthreads)-1]['auth']=$el[1];
        } 
    if (
$name == "date"
        { 
        echo 
"On $el[1],"
         
$cdthreads[count($cdthreads)-1]['date']=$el[1];
        } 
    if (
$name == "time"
        { 
        echo 
" at $el[1]<p>"
         
$cdthreads[count($cdthreads)-1]['time']=$el[1];
        } 

    } 
// At this point, all the threads have been printed out if PRINTOUT equaled one
// Also all the threads are stored in $cdthreads associative array.

?>

Last edited by Brandon Martus : 02-08-2016 at 08:18.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonomous workking differently tethered in pits, than from feed during competition. Elgin Clock Programming 12 24-03-2003 17:00
NASA Feed on Charter Cable TV dhendrix General Forum 9 24-03-2003 09:12
Transponder info for live feed... archiver 2000 1 23-06-2002 22:14
NASA-TV Feed URL anyone? archiver 2001 3 23-06-2002 22:10
Opinions of teh TV feed Wetzel Chit-Chat 4 29-04-2002 00:46


All times are GMT -5. The time now is 08:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi