Extract all images out from each node in content type Every time a new node is published within a single content type, I wish to extract (not remove) all the images out from that node's body and save the URL(s) of the images in the database. I will then use the URLs to make a slideshow of the images on a separate node.

I have three questions:


Which hook runs right before a node is published?
What's the best way of saving those URLs in the database?
Which Drupal function do I use to retrieve those URLs from the database?
Which book runs right before a node is published?



hook_node_update($node) The hook is invoked after the node is inserted/updated in the node table



  What's the best way of saving those URLs in the database?



It totally depends upon your needs, Simply you will have to save in database in your own table(s).



  Which Drupal function do I use to retrieve those URLs?



It is not clear from where you want to retrieve. Database or Node Body.

For database you need to focus on Database abstraction layer
For Node body, you will have to parse some way e.g. PHP Simple Dom Parser