Page 3 of 3

Re: RSS feed

Posted: Fri Jun 19, 2009 5:06 am
by dmitry_vk
Harleqin wrote: - Reading a page into a string should be possible much easier.
The easy way is to use DRAKMA.

Code: Select all

(drakma:http-request uri)
will return you a string (http-request has _a lot_ of options, it can return not just strings).

Re: RSS feed

Posted: Fri Jun 19, 2009 8:06 am
by schoppenhauer
Maybe another interesting question would be whether the thing it basically does is usefull to provide an RSS-Feed for this Forum (no matter how exactly it is implemented now).

Re: RSS feed

Posted: Fri Jun 19, 2009 9:24 am
by Harleqin
schoppenhauer wrote:
Harleqin wrote:Regarding the HTML parsing: I haven't done this before, but I thought of Closure HTML.
Try it :D (Its possible, but annoying)
This should work, but I can't test it currently:

Code: Select all

(defun get-entries (path)
  (let ((page (chtml:parse (trivial-http:http-get path) (stp:make-builder)))
        (entries ()))
    (stp:do-recursively (el page)
      (when (and (typep el 'stp:element)
                 (equal (stp:local-name el) "a")
                 (equal (stp:attribute-value el "class") "topictitle"))
        (push (cons (stp:attribute-value el "href")
                    (stp:string-value el))
              entries)))))
Note that it parses the stream directly, and doesn't need the html-page-to-string function. It uses Closure HTML and CXML-STP (a nice alternative for DOM).
schoppenhauer wrote:Maybe another interesting question would be whether the thing it basically does is usefull to provide an RSS-Feed for this Forum (no matter how exactly it is implemented now).
Yes, absolutely. ;)

Re: RSS feed

Posted: Fri Jun 19, 2009 9:33 am
by findinglisp
Just so we're clear... LispForum runs on phpBB on a shared hosting account. I have no ability to run any CL on that system, so it really doesn't matter in terms of adding RSS capabilities to the forums. There are several RSS systems for phpBB, but phpBB being written in PHP, they all require you to actually patch the phpBB source code directly. I simply haven't had the time to try them all out. Kroger offered to do some research to come up with the best RSS implementation and then I'll have to go in and patch things.

Re: RSS feed

Posted: Fri Mar 19, 2010 2:39 pm
by Jasper
Just +1 on wanting RSS. Tbh that this forum system doesn't support it defaultly seems little pathetic... I made an(admittedly untested) rss writer for 'my' project, and it isn't that hard..

Not to diss anyone except for phpBB board :p

Re: RSS feed

Posted: Mon Mar 22, 2010 6:08 pm
by findinglisp
Jasper wrote:Just +1 on wanting RSS. Tbh that this forum system doesn't support it defaultly seems little pathetic... I made an(admittedly untested) rss writer for 'my' project, and it isn't that hard..

Not to diss anyone except for phpBB board :p
Yes, agreed. I would thought that having RSS embedded into every web application these days would be the default, but alas it is not.