• Yahoo!
  • My Yahoo!
  • Mail
  •      Make Y! your home page
Yahoo! Search
Do you have feedback/suggestions for the Pipes team? We want to hear from you!
View: Simple | Summary | Expanded
As: Threaded | Msg List
Page 1 of about 1   First | < Prev | Next > | Last
Messages in Topic
View messages rated: What's this?
Rewritting item description with regex     10-Jun-08 11:20 am    
I've created a pipe that pulls from the Halo 3 screenshot feeds from bungie.net.

In this pipe, http://pipes.yahoo.com/scotgun/halo3_rec... item.description is a url to a jpeg. I want to use regex to replace the url with an image container that has the url as it's source. The goal is to be able to view the images in the pipe output.
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott Gunsaull...

32/Male
Town and Co...


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     10-Jun-08 11:38 am    
You need to rename to description, not item.description.
In the Regex module you can use the rule
In [item.description] replace [(.*)] with [<img src="$1" />] (omit outer []s).
Rating :
 (1 Rating)
Rate it:
awful/not related to \pooraveragegoodexcellent

hapdaniel

58/Male
NA


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     10-Jun-08 01:42 pm    
Thanks. I tried your suggestion. Unfortunately, the images are not showing in the output. I looked at the description source in output debug. The output is simply <img/>. The SRC= tag is missing.
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott Gunsaull...

32/Male
Town and Co...


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     10-Jun-08 02:09 pm    
Sorry. I've got a little ADD. I had not renamed to "description," when I posted 20 minutes ago. Now, the regex expression is behaving. Thanks.
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott Gunsaull...

32/Male
Town and Co...


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     10-Jun-08 03:27 pm    
I'm not sure about this one.
In the debugger and in the RSS output in Firefox I see what I would expect. In the Pipes view/run page I see no description. In my usual RSS reader I see a "Screenshot not found" image.
Rating :
 (1 Rating)
Rate it:
awful/not related to \pooraveragegoodexcellent

hapdaniel

58/Male
NA


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     10-Jun-08 06:30 pm    
Thanks. I was hoping that you'd take another look. The screenshot not found image is a bungie.net 404 of sorts. First guess is that the problem is on their end and is probably deliberate. They really don't want you pulling the screenshots off their site. That's why their original RSS interface didn't contain a description.

I'm going to consult bungie.
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott Gunsaull...

32/Male
Town and Co...


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     11-Jun-08 04:03 pm    
New development:

I was playing around with the image containers, the HTML code generated by the pipe. If I put them in a simple html page, they execute with the same error, the bungie gremlin 404. Then, I get an explorer security bar prompt. You know, the one that says blocked active content...do you want to view...etc. I click yes and the image is served like normal.

Then, when I run the pipe, that image and only that image appears in the xml feed.

Yikes this is a pain!
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott Gunsaull...

32/Male
Town and Co...


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     17-Jun-08 09:47 am    
Here's my pipe -- do I need to publish it to let you see it?

http://pipes.yahoo.com/pipes/pipe.info?_...

My feed draws from a google reader feed -- specifically from a portion of an item containing a tag (for filtering in an earlier pipe), separators (for simpler regex), a URL (image source), and text (image alt).

I'd like to construct html like this [<img src="URL" style="width: USERINPUT;" alt="TEXT">]

But when I regex to create the string, I can't seem to insert the [<img src="] without having the engine insert its own [>] before the URL.

Is there a simple escape mechanism to just build the html, then have the feed output exactly what I'm aiming for?

The above would be great. Even better would be this: [<a target="_blank" href="ITEMLINK"><img src="URL" style="width: USERINPUT;" alt="TEXT"></a>]

This seems like it should be easier, but I'm a regex noob -- Is there a simple fix here?

S.
Rating :
 (No ratings)
Rate it:
awful/not related to \pooraveragegoodexcellent

Scott R

Male


View Messages

Ignore User

Report Abuse

Re: Rewritting item description with regex     17-Jun-08 11:37 am    
You really should have created a new thread for your question, since it's only marginally connected to the original theme.

Anyway, I think a couple a regular expressions should achieve what you want. These rules should be in a Regex module, which is different from a String Regex module.
In [item.width] replace [^] with [connect your width input here]
In [item.gr:annotation.content.content] replace [(?s).*?href="([^"]+).*::\s*(.*)] with [<a href="${link}"><img src="$1" style="width:${width};" alt="$2"></a>]
Remove all the outer []s. If any spaces appear in the middle parts of the rule please remove them, since they were added by the board editor.
Rating :
 (1 Rating)
Rate it:
awful/not related to \pooraveragegoodexcellent

hapdaniel

58/Male
NA


View Messages

Ignore User

Report Abuse

View: Simple | Summary | Expanded
As: Threaded | Msg List
Page 1 of about 1   First | < Prev | Next > | Last