CodingYahoo Pipes

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Mouse  
 To:  ALL
36596.1 
People of Teh.

I have been having a play with Yahoo Pipes. It's actually quite good I think. Basically takes RSS feeds and website feeds and shing, aggregates them and lets you mould them and spits it out into one big feed.

Now, those who I have pestered on MSN et al in the past will know I am to coding what NWA were to Police Christmas Parties.

So I have the following conundrum. I'm taking feeds from local venue's Myspace events listings and getting them all to combine into one listing. So far so good but I need to order it by event date, not publishing date for it to make sense.

So I have in the Description field (field? I need to learn the proper terms too...) this:

code:
<div class="vevent"><p class="description">Wednesday, Sep 16 2009<br /> <span class="location">Hot Springs, Arkansas</span><br /> 9:00 PM </p> </div>

 
If I order it by Description class (class?) then it of course groups all events on a Wednesday together and all groups on a Saturday together etc. So I need to get it to probably delete the days so that it will then order by description and put things in actual date order, but I don't know how :(
 
Someone fancy being patient and helping me?
 
 

Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Mouse     
36596.2 In reply to 36596.1 
quote:
I am to coding what NWA were to Police Christmas Parties.


(giggle)


The Seventh Posture of Burton's translation of The Perfumed Garden is an unusual position not described in other classical sex manuals. The receiving partner lies on their side. The penetrating partner faces the receiver, straddling the receiver's lower leg, and lifts the receiver's upper leg on either side of the body onto the crook of penetrating partner's elbow or onto the shoulder. While some references describe this position as being "for acrobats and not to be taken seriously," others have found it very comfortable, especially during pregnancy.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.3 In reply to 36596.1 
Are all the RSS feeds in the same format? (i.e. do they all have that format of description?)

Can you provide sample feeds?
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.4 In reply to 36596.3 

Yeah, all the same format. So far I've got:

 

http://makedatamakesense.com/myspace/event/?url=http://www.myspace.com/mannvillearms&format=rss&style=no-summary

 

http://makedatamakesense.com/myspace/event/?url=http://www.myspace.com/balangabasement&format=rss&style=no-summary

 

http://makedatamakesense.com/myspace/event/?url=http://www.myspace.com/theexchangevenue&format=rss&style=no-summary

 

http://makedatamakesense.com/myspace/event/?url=http://www.myspace.com/gasworksbar&format=rss&style=no-summary


Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.5 In reply to 36596.4 
Unless I'm missing something, those all have pubDate which have the correct date field?

In theory, you just get Yahoo Pipes to format that as yyyy-mm-dd HH:mm:ss and you're fine.

Except this interface really is incredibly shit, and I can't figure out how to tell it to do that. :/

Option two doesn't need date formatting, just extract the title attribute from the .dtstart tag in the description and you've got a suitably formatted timestamp.
Again, shit interface; can't figure out how to get that as a distinct field.

So, third option, apply a regex transform to the description and put the timestamp at the front.

To do that, add an Operators>Regex and replace item.description as follows:
replace =
code:
(.*?)(<abbr.*?class="dtstart".*?title="([^"]+)"[^>]*>)

with =
code:
<!-- $3 --> $1$2


That's not the most efficient way, and it's a little fragile if the original HTML changes too much, but it works.

Gah! No it doesn't - looking at the RSS feeds, they all seem to have the .dtstart information, but at some point it seems to be dissappearing. :/
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.6 In reply to 36596.5 

Right, the PubDate is useless. That's the date/time that the event was added. I need to order it by the date which is in the Desciption bit. Which is the date of the event. But oh yeah, it's in that dtstart thing..

 

I'll have a proper check when I'm not on my phone, I think the second option might be a goer if I can furrow my brow deep enough to understand it. CHEERS PETER.


Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.7 In reply to 36596.4 
Ok, think I got it.

You need to create a Loop item, and then drag a new Date Formatter into that, and use %F %T to get an appropriate format.

Like this...

Attachments:

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.8 In reply to 36596.6 
I'm confused. :S

Excluding broken timezone stuff, the pubDate seems to be matching the values in the description for all the ones I'm looking at?

Attachments:

0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.9 In reply to 36596.7 
Ooo, sort of.. but the pubDate is of no use. I need it sorting by the info in

tag or the dt start one. This will the events in chronological order of when things are happening, not the prder they were published in which I'm not interested in.


Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.10 In reply to 36596.8 
Sorry, let me look ay this when I'm not on my phone. Tomorrow aft maybe. Pub crawl time now.

Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.11 In reply to 36596.6 
If you're certain you need the Description bit, you can extract and re-format it like this: (attached).

With the regex replace used being this:
code:
^<div .*?class="vevent"[^>]*>\s*<p .*?class="description"[^>]*>\s*\S+ (\S+) (\S+) (\S+)<br />.*$


Again, fragile if things change, but otherwise it works.

Attachments:

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.12 In reply to 36596.9 
Well Yahoo is crap and is killing the .dtstart part, which would be the best one to go for, but see above for extracting the p.description part.
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.13 In reply to 36596.12 

Ooo yay! Got it working now. I apologise, the pubdate it seems was the same as the event date. Which doesn't make any sense but does mean it will work.

 

Thanks Pete, you're a star.


Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.14 In reply to 36596.13 
Hooray! *twinkles*
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.15 In reply to 36596.14 
Just got to figure out how to get the actual venue name in the listing, which is probably going to be hard as the actual venue name isn't in the feed's information...

Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mouse     
36596.16 In reply to 36596.15 
If you can link the venue to the feed, you can use one of the string bits to specify it manually, then instead of one feed block with multiple urls, create one feed for each url, add the venue, and use the union one to combine the results.

(or something like that - on my mobile at the moment, so can't check specifics)
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  Peter (BOUGHTONP)     
36596.17 In reply to 36596.16 
Ahhh, yeah. I think I know what you mean. I'll have a fiddle.

Which of the following would you most prefer?
A: a puppy,
B: a pretty flower from your sweety, or
C: a large properly formatted data file?
0/0
 Reply   Quote More 

Reply to All    
 

1–17

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats