I love the devel_generate integration for Amazon. It makes it so much easier to test with ASIN fields.

The one problem: If you generate some nodes, you'll get a bunch of duplicate ASINs. I'd rather see this generate unique ones. Could probably be improved other ways too, but ...

Thanks!

Comments

shawn dearmond’s picture

Status: Active » Needs review
StatusFileSize
new833 bytes

The issue here is that the generate script is searching Amazon, finding a random item, and then searching Amazon again for the next node.

Of course, what's being searched is the same keyword: "drupal" over and over and over again. There are only so many items that come up when you search for "drupal", which is why duplicates are appearing.

Here's one solution: instead of a single keyword to search for, let's have it randomly select one of, say, 10. That will diversify the results a bit, but it won't completely remove the possibility of a duplicate.

See attached patch.

I also changed the search from "Blended" to "All", so search results are far far more relevant. (And I get the impression that it's faster, though I haven't timed it with a stopwatch.)

rfay’s picture

Status: Needs review » Fixed

Committed: fc48d5506c77064438c7b30a4ba2c92d955fe821

rfay’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Let's go back and pick this up in D6 as well please.

rfay’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Patch (to be ported) » Fixed
StatusFileSize
new3.11 KB

Here's another view of this. This time I used a single keyword that's guaranteed to generate a lot of things, and actually keep track of where we are in generating. It's not elegant, but you get unique items, and pretty much as many as you want.

Committed: f599c0c39f9f16e2e20a066d7ed17a3144e1ed3d

rfay’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Now we could take the both of these back to D6.

the_g_bomb’s picture

Status: Patch (to be ported) » Fixed
StatusFileSize
new1.46 KB

This looked to be already implemented in D6.

All this patch does is set the default variables to the same values as the D7 version.

Committed 987ca21 to 6.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.