Search and replace of feed item during Autoblog processing.
WPMU DEV Community
Search and replace of feed item during Autoblog processing.
Elite
16 pointsStarting to get into this DEV thingI'm new here
McPace
Member
—
19th January 2012 (4 months ago)
I'd like an add-on that allows autoblog to search for text and replace it with something else. This would give the ability to parse an item of a feed.
For example I have a feed of events we are holding for the year. (http://www.cvent.com/Events/feeds/rss.aspx?f=02e3080a-dc7c-496c-892a-f9d64f449b11) The event team uses Cvent, and we cannot alter the way the feed is created. I want to use autoblog to take each feed item and make a post out of it, taking parts of the content and mapping it to custom fields. I'll then use the post and the custom fields in the post to display the upcoming events on various pages on my network.
I need to get the location (city and state is possible), the date, the event type, and the link back to the registration page. The date of the item is the date of the event.
A competing plugin offers this description for this: "Feed-specific search and replace features using regular expressions to rewrite words, URLs, fix invalid content, replace affiliate IDs, etc."
I'd like an add-on that allows autoblog to search for text and replace it with something else. This would give the ability to parse an item of a feed.
For example I have a feed of events we are holding for the year. (http://www.cvent.com/Events/feeds/rss.aspx?f=02e3080a-dc7c-496c-892a-f9d64f449b11) The event team uses Cvent, and we cannot alter the way the feed is created. I want to use autoblog to take each feed item and make a post out of it, taking parts of the content and mapping it to custom fields. I'll then use the post and the custom fields in the post to display the upcoming events on various pages on my network.
I need to get the location (city and state is possible), the date, the event type, and the link back to the registration page. The date of the item is the date of the event.
A competing plugin offers this description for this: "Feed-specific search and replace features using regular expressions to rewrite words, URLs, fix invalid content, replace affiliate IDs, etc."
8202 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
WPMU DEV Fanatic
—
20th January 2012 (4 months ago)
#
Hi McPace,
I'm sure a regexp search/replace wouldn't be too difficult, especially as relevant code is used in the Membership plugin by the same core plugin author here. And it sounds incredibly useful too.
But you've mentioned the additional ability to be able to create separate posts depending on the parsed content. That sounds rather like 2 different add-ons. Is that the case, or is it that you'd rather have an add-on that conditionally creates posts based on parsed content?
Have a look at the Twitter add-on that is included in the Autoblog plugin, this does some processing on each feed item and parses it (and adds links) to enhance the content. This may provide a starting point for your new add-on
Hi David, thanks for the response. Sorry I must not have communicated properly. I don't want to create separate posts after parsing. I want to map the parsed content into custom fields of one post.
For example a feed item title of 'Really Cool Training Las Vegas, NV - December 3rd'
So create a post as usual and parse that title into different custom fields.
Find start of title until the word training, map that to the custom field %title
Find next words till comma, make that %city
Take two letters after comma, map that to %city custom field
All in one post.
@Barry, thanks. I wasn't planning on developing an addon myself, I was putting in a feature request. Was this the right place to do so?
Responses (3)
WPMU DEV Fanatic — 20th January 2012 (4 months ago) #
Hi McPace,
I'm sure a regexp search/replace wouldn't be too difficult, especially as relevant code is used in the Membership plugin by the same core plugin author here. And it sounds incredibly useful too.
But you've mentioned the additional ability to be able to create separate posts depending on the parsed content. That sounds rather like 2 different add-ons. Is that the case, or is it that you'd rather have an add-on that conditionally creates posts based on parsed content?
-David
Developer — 20th January 2012 (4 months ago) #
Have a look at the Twitter add-on that is included in the Autoblog plugin, this does some processing on each feed item and parses it (and adds links) to enhance the content. This may provide a starting point for your new add-on
Member — 20th January 2012 (4 months ago) #
Hi David, thanks for the response. Sorry I must not have communicated properly. I don't want to create separate posts after parsing. I want to map the parsed content into custom fields of one post.
For example a feed item title of 'Really Cool Training Las Vegas, NV - December 3rd'
So create a post as usual and parse that title into different custom fields.
Find start of title until the word training, map that to the custom field %title
Find next words till comma, make that %city
Take two letters after comma, map that to %city custom field
All in one post.
@Barry, thanks. I wasn't planning on developing an addon myself, I was putting in a feature request. Was this the right place to do so?
Become a member