Another idea is to use the Blogger API, and scrape the resulting JSON
containing all my posts.

You can make a URL on my blog like so:

    : re-factor-url ( str -- url )
        "http://re-factor.blogspot.com/"; prepend ;

Getting all the posts back as a huge JSON document (right now I have like
170 posts, so 200 max results should be "good enough" for awhile):

    : posts-url ( -- url )
        "feeds/posts/default?alt=json&max-results=200" re-factor-url ;

All the posts can be found by navigating the json document to the "feed"
and "entry" keys, memoizing so subsequent calls in the listener are fast:

    MEMO: all-posts ( -- posts )
        posts-url http-get nip json> { "feed" "entry" } [ of ] each ;

Then, you can print them out in the listener, and make them URLs that can
be right-clicked and opened in your browser:

    CONSTANT: post-style H{
        { foreground COLOR: blue }
    }

    : posts. ( -- )
        all-posts [
            [ "title" of "$t" of ] [ "link" of ] bi
            over '[ "title" of _ = ] find nip "href" of
            >url post-style [ write-object ] with-style nl
        ] each ;

How's that?






On Thu, Sep 5, 2013 at 9:04 AM, John Porubek <jporu...@gmail.com> wrote:

> I'm re-posting this message since I didn't get an answer the first
> time and I'm nothing if not persistent!
>
> Let me recast the original question differently. Is there a fairly
> easy way, using Factor, to scrape a blog website for a list of blog
> titles? This seems like it would be a really useful tool for finding
> information, assuming the author chose fairly meaningful titles.
>
> I'm no expert in web technology, but it occurs to me, as I think about
> this problem, that it might be kind of difficult in the general case.
> I have no idea how similar different blogs might be. For now, I'm most
> interested in the special case of John Benediktsson's "Re:Factor"
> blog.
>
> Thanks,
>
> -John
>
> ---------- Forwarded message ----------
> From: John Porubek <jporu...@gmail.com>
> Date: Mon, Aug 19, 2013 at 5:52 PM
> Subject: Re: [Factor-talk] Wiki Tutorial
> To: factor-talk@lists.sourceforge.net
>
>
> John,
>
> Is there a way to get an index (one line per blog entry) of all your
> posts? Google Reader used to do that for me. Feedly provides a nice
> listing, but it only goes back about a year (I don't know about other
> RSS readers - anybody care to suggest a better one?). The search
> feature is appreciated, but is not always what I need, because often I
> don't know what to call what I'm looking for.
>
> Your blog has been an invaluable source of information (and sometimes
> inspiration!) for me. Thanks for your efforts.
>
> -John
>
> P.S. Chris Double's blog is also quite helpful and this link:
> http://www.bluishcoder.co.nz/tags/factor/ , presents a nice index.
>
>
> On Sun, Aug 18, 2013 at 10:13 PM, John Benediktsson <mrj...@gmail.com>
> wrote:
> >
> > Aside from the information in the docs, I would point you to a few
> resources:
> >
> > @malu has a "blog" git-tutorial
> > https://github.com/malu/factor-blog-gitutorial
> >
> > @doublec has a (somewhat stale) factor tutorial book
> > https://github.com/doublec/factor-articles
> >
> > @mrjbq7 has a bunch 160+ posts on Re: Factor blog:
> > http://re-factor.blogspot.com/
> >
> > Also, on the last one there are links on to a "Factor Playground"
> > http://personal.inet.fi/koti/egaga/jsfactor/playground.html
> >
> > And a Google tech talk by @slavapestov
> > http://www.youtube.com/watch?v=f_0QlhYlS8g
> >
> > I love feedback so if you want to suggest some things, or start a
> section on either the concatenative.org wiki or the github wiki that
> would be great.
> >
> > Best,
> > John.
> >
> >
> > On Sun, Aug 18, 2013 at 3:09 PM, Mark Green <m...@antelope.nildram.co.uk>
> wrote:
> >>
> >> Hi Charles,
> >>
> >> Thanks for your reply, I am aware of the docs online, I have been
> working on writing a bit of an introduction to basic Factor (I plan to
> introduce it to some programming students as an example of concatenative
> programming) and was wondering if there was somewhere I could post it where
> it could help and be expanded by myself and other people - I remember a
> post here saying that a longer Factor tutorial was something that people
> were interested in.
> >>
> >> Mark
> >>
> >>
> >> On Sun, Aug 18, 2013 at 12:44 AM, Mark Green <
> m...@antelope.nildram.co.uk> wrote:
> >>>
> >>> Hi,
> >>>
> >>> Is there any Wiki where a Factor tutorial is being or could be built?
> >>>
> >>> Mark
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> >> It's a free troubleshooting tool designed for production.
> >> Get down to code-level detail for bottlenecks, with <2% overhead.
> >> Download for free and get started troubleshooting in minutes.
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Get 100% visibility into Java/.NET code with AppDynamics Lite!
> > It's a free troubleshooting tool designed for production.
> > Get down to code-level detail for bottlenecks, with <2% overhead.
> > Download for free and get started troubleshooting in minutes.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to