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!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | amazon-devel_generate_unique_1127644_05.patch | 1.46 KB | the_g_bomb |
| #4 | amazon.devel_generate_unique.patch | 3.11 KB | rfay |
| #1 | amazon_devel_generate-1127644-1.patch | 833 bytes | shawn dearmond |
Comments
Comment #1
shawn dearmond commentedThe 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.)
Comment #2
rfayCommitted: fc48d5506c77064438c7b30a4ba2c92d955fe821
Comment #3
rfayLet's go back and pick this up in D6 as well please.
Comment #4
rfayHere'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
Comment #5
rfayNow we could take the both of these back to D6.
Comment #6
the_g_bomb commentedThis 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