Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

Generating a list of stories that don't have any keywords

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


phillip at communitybandwidth

Jul 16, 2008, 10:22 AM

Post #1 of 7 (309 views)
Permalink
Generating a list of stories that don't have any keywords

Hi ho,

Any suggestions for generating a list of stories that have no keywords
(so someone can go through the list and add them)?

Phillip.

--
Phillip Smith,
Simplifier of Technology
Community Bandwidth
http://www.communitybandwidth.ca


david at kineticode

Jul 16, 2008, 10:41 AM

Post #2 of 7 (294 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

On Jul 16, 2008, at 10:22, Phillip Smith wrote:

> Any suggestions for generating a list of stories that have no
> keywords (so someone can go through the list and add them)?

I think you'd have to do straight SQL. Sorry.

Best,

David


john at grumpet

Jul 16, 2008, 11:11 AM

Post #3 of 7 (294 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

I'd do something like:

perl -MBric::Biz::Asset::Business::Story -e 'foreach
$story(Bric::Biz::Asset::Business::Story->list()){print
$story->get_title() . "\n" if scalar @{$story->get_keywords()} < 1}'
>>list.txt


John


David E. Wheeler wrote:
> On Jul 16, 2008, at 10:22, Phillip Smith wrote:
>
>> Any suggestions for generating a list of stories that have no
>> keywords (so someone can go through the list and add them)?
>
> I think you'd have to do straight SQL. Sorry.
>
> Best,
>
> David


phillip at communitybandwidth

Jul 16, 2008, 12:22 PM

Post #4 of 7 (294 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

Perfect. Thanks!

:-)

On 16-Jul-08, at 2:11 PM, John Greene wrote:

> I'd do something like:
>
> perl -MBric::Biz::Asset::Business::Story -e 'foreach
> $story(Bric::Biz::Asset::Business::Story->list()){print $story-
> >get_title() . "\n" if scalar @{$story->get_keywords()} < 1}'
> >>list.txt
>
>
> John
>
>
> David E. Wheeler wrote:
>> On Jul 16, 2008, at 10:22, Phillip Smith wrote:
>>
>>> Any suggestions for generating a list of stories that have no
>>> keywords (so someone can go through the list and add them)?
>>
>> I think you'd have to do straight SQL. Sorry.
>>
>> Best,
>>
>> David

--
Phillip Smith,
Simplifier of Technology
Community Bandwidth
http://www.communitybandwidth.ca


david at kineticode

Jul 16, 2008, 12:30 PM

Post #5 of 7 (295 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

On Jul 16, 2008, at 11:11, John Greene wrote:

> perl -MBric::Biz::Asset::Business::Story -e 'foreach
> $story(Bric::Biz::Asset::Business::Story->list()){print $story-
> >get_title() . "\n" if scalar @{$story->get_keywords()} < 1}'
> >>list.txt

As long as you don't have a lot of stories, that's fine. But if you
have 1000s, it will be pretty slow, I should think. That will execute
a *lot* of queries (one for all stories, then one to get keywords for
each story).

Best,

David


john at grumpet

Jul 16, 2008, 12:39 PM

Post #6 of 7 (294 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

David E. Wheeler wrote:
> On Jul 16, 2008, at 11:11, John Greene wrote:
>
>> perl -MBric::Biz::Asset::Business::Story -e 'foreach
>> $story(Bric::Biz::Asset::Business::Story->list()){print
>> $story->get_title() . "\n" if scalar @{$story->get_keywords()} < 1}'
>> >>list.txt
>
> As long as you don't have a lot of stories, that's fine. But if you
> have 1000s, it will be pretty slow, I should think. That will execute
> a *lot* of queries (one for all stories, then one to get keywords for
> each story).
>
> Best,
>
> David

This is correct; it's only good for a one-off list. I ran it on an
instance with 3247 stories, and it took aproximately 15 seconds to
complete. I wouldn't put such code in a template. ;)

John


phillip at communitybandwidth

Jul 17, 2008, 8:51 AM

Post #7 of 7 (278 views)
Permalink
Re: Generating a list of stories that don't have any keywords [In reply to]

On 16-Jul-08, at 3:39 PM, John Greene wrote:

>
> David E. Wheeler wrote:
>> On Jul 16, 2008, at 11:11, John Greene wrote:
>>
>>> perl -MBric::Biz::Asset::Business::Story -e 'foreach
>>> $story(Bric::Biz::Asset::Business::Story->list()){print $story-
>>> >get_title() . "\n" if scalar @{$story->get_keywords()} < 1}'
>>> >>list.txt
>>
>> As long as you don't have a lot of stories, that's fine. But if you
>> have 1000s, it will be pretty slow, I should think. That will
>> execute a *lot* of queries (one for all stories, then one to get
>> keywords for each story).
>>
>> Best,
>>
>> David
>
> This is correct; it's only good for a one-off list. I ran it on an
> instance with 3247 stories, and it took aproximately 15 seconds to
> complete. I wouldn't put such code in a template. ;)

Seemed to work for a one-time, story-type limited, use within a
template. :-)

--
Phillip Smith,
Simplifier of Technology
Community Bandwidth
http://www.communitybandwidth.ca

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.