0

Modifying feed - Replace text within boundaries with another text within boundaries

Hi, I am trying to modify Pinterest feed - here is my pipe

So far I have replaced two strings, but I have problem with item.title. Pinterest decided to provide for rss feed only 20 characters from picture description which is pity (although I understand a bit why). Anyway this title is also in item.description.

What I would like to achieve is pull text from item.description which is limited by html characters

<-p>Kim Bora // Jamirang no.2<-/p> (sign - used because of text formatting)

And replace text in item.title limited by text

titleKim Bora // Jamirang link

Please advise if such thing is possible with pipes and how. Thank you.

by
4 Replies
  • I'm not sure I understand what you wrote... anyway, to extract the content within the p mark-up, you can use a regex module, easy as your description field looks like to always be of the form

    ...

    [what you want]

    . To do so, use a regex of the form

    .*

    (.*)

    , as I did here: http://pipes.yahoo.com/luneart/bc62007497377b017eb3975643428cf6

    Ireally don't understand your second action. Do you want to replace the whole title by the extracted content? if so, really easy, in the rename module put 'title'. if not, please explain, I understand quickly, but I need people to explain a long time :p

    0
  • forgot the markdown, sorry: I'm not sure I understand what you wrote... anyway, to extract the content within the p mark-up, you can use a regex module, easy as your description field looks like to always be of the form <p>...</p><p>[what you want]</p>. To do so, use a regex of the form <p>.*</p><p>(.*)</p>, as I did here: http://pipes.yahoo.com/luneart/bc62007497377b017eb3975643428cf6

    I really don't understand your second action. Do you want to replace the whole title by the extracted content? if so, really easy, in the rename module put 'title'. if not, please explain, I understand quickly, but I need people to explain a long time :p

    0
  • Thank you very much!

    If you check my pipe again I have used your suggestions, played a bit and yes replaced title. Problem is that pinterest doesn't have titles, only description, and pro-forma title is extracted arbitrarily from this description. So I wanted to extract title from description my way - I have used ; as end of phrase I want to use so it looks like this <p>.*</p><p>(.*);.*</p>

    And asnwer to your question is yes. I wanted to replace whole title with part of text in description limited by ><p> and;

    0
  • Hi When I go to your pipe I see the old source I don't know why. However from your regex, I see troubles ahead: in the description field you're extracting the title from, the format is always of the form <p>.*</p><p>(.*);.*</p>? I mean, does the semi colon always is appear in the field? In my opinion you should go with a regex of the form <p>.*</p><p>([^;<]*) with [^;<] meaning any character except semi colon or <. enjoy ;)

    0

Recent Posts

in Pipes