Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

How to load data into stories?

posted by Krow on 12:50 PM October 18th, 2000   Printer-friendly   Email story
DarkMoon writes "HI, I want to do the following:

I got about 500 megs of data in tab delimited ascii format distributed over 14 tables.

I would like to pull the data out of those tables (no problem)
then HTML format this data PROBLEM
then dump it into the corresponding slash code tables to have this data apear as "stories" (problem)

At this point I can't really reveal exactly what we are trying to do, BUT it will be amazing, and we will share with everyone how it was accomplished. (unlike some other guys which register patents on work derived from the open source community) This brings me to another problem: How do I get the search engine to also search the FULL story text, not only the intro text?

Another interesting question is to how do you get sections working a la /. so taht the different section show up in different colors?

Thanx alot for any pointers"

Under Bender you can use the API method in Slash::DB saveStory() under main you are just going to need to insert the data directly into the table. You might look at Bender's saveStory() method as a rough outline of what needs to happen.
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • Bender? the new version of the slashcode?
  • 1) look at the submit.pl code. You should be
    able to rip most of the important story posting code out of it.

    2) As far as html'izing your data, I think
    I'd do something like

    $plain = encode_qp $text;
    $html = encode_entities($text);
    $html =~ s/\n\n/\n\n<p>/g;
    $html =~ s/\n/<br>\n/g;
    $html = "<p><strong>" . $html . "</strong></p>";

    I'm sure there's better ways. Do a deja search and a cpan search for code to help you out.

    3) As far as the search.pl that slashdot has, I've never taken the time to look at it. I'd always assumed it did a match on the story subject and that was it.

    An easy solution would be to grab something like
    the Webinator from http://www.thunderstone.com/webinator/ (it's free I believe). That'll do full text searching w/o much hassle.


    --
    lottadot [lottadot.com]
  • I have been looking around on how sections work, got the "sections colors" to show up in the colors menu by recreating a color block and naming it "sectionname_colors".

    Do I have to do this for all blocks I want to show in a section. so that I have a different color sheme for each section? ie: "sectioname_story", "sectioname_header", "sectionname_footer", etc...?