I am using the feeds module to import an rss feed from twitter. The feed title and body starts with ": then my tweet". I wish to remover ":" from the creation of my nodes. I can remove it in the body by using a custom input format that removes it. However I can't remove it from the title.
I suppose I have two options:
- While saving the nodes of my custom content type, remove the text
- create a custom plugin for feeds
What do you think is the best way to do this? Should I try another way?
Update
I added hook_node_presave to deal with this. As it is called on both the insert and update.
/**
* Implementation of hook hook_node_presave
*/
function my_module_node_presave($node) {
if($node->type=='mytype'){
$node->title = _my_module_my_function($node->title);
$node->body[$node->language][0]['value'] = _my_module_my_function($node->body[$node->language][0]['value']);
}
}
It works great but is this the correct place to be doing the check and removal?