1

I have been given the task to generate a couple of thousand of pages in drupal that should contain text generated by a php-script. After that is done, I'm supposed to perform searches on the generated words and play with the settings in Drupal to make the searching as fast as possible.

I have the php-script that generates the text but what I am asking for is the php-script that generates the pages and for each one calls my php-script to put a mass of generated text on the page.

I know that there is a file in Drupal that I can use since I read this page https://api.drupal.org/api/drupal/scripts!generate-d7-content.sh/7, but that one generates text that I can't perform my searches on. I think I need to modify it to call for my own text generator but I'm not sure of how?

Is there someone out there that maybe could help me? It would be most appreciated!

1
  • 1
    Hello. Have you read How to create nodes using node_save? question? Or any one of numerous questions about node creation & import? Have you actually tried to play with this sh script? How you failed? – Mołot Oct 4 '13 at 7:58
1

You can use contrib module for that purpose

Devel

Generate content

Accelerate development of your site or module by quickly generating nodes, comments, terms, users, and more.

Dummy content

DC allow your custom module to provide demo nodes as soon as the module is installed - this helps with populating blocks, views, and generally showcasing your module's functionality. This is very useful when showcasing a module's functionality to a client. For example, rather than installing the Forum module and having to manually create forum nodes, the DC API can be used to pre-populate the site with forum-type nodes as soon as the Forum module is enabled. Additionally, rather than having purely Lorem Ipsum-type content, you can define relevant pieces of text and images, giving the content a more complete & realistic look & feel.

Note: Both modules will create random content.

6
  • 1
    But she already have a PHP script to generate the text for her nodes. If you know how to use external function with above modules, please share. I don't think it's possible. Now I don't think it answers her question. – Mołot Oct 4 '13 at 8:01
  • @Molot Dummy content module provides api to generate content for nodes, so i guess using the API's should help – arpitr Oct 4 '13 at 8:05
  • But it has 3 hooks only, and they only allows to set subjects, not actual data? Unless api description on their main page lacks substantial parts. – Mołot Oct 4 '13 at 8:10
  • You are right , it looks like content is being generated on random basis with helper class as "class.dctext.inc" inside "dummy_conent/includes/" – arpitr Oct 4 '13 at 8:24
  • 1
    Going back,I guess writing the script will be faster way! :D – arpitr Oct 4 '13 at 8:48
0

I would go the other way around. You can easily modify your script to generate XML of texts. With that, you could import your XML with Feeds module. It maps XML fields to content fields pretty OK now, so it should be easy enough for simple content type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.