We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

FeedGrab and Entry Dates, how to (Please move to correct forum)

Development and Programming

Briggs's avatar
Briggs
111 posts
18 years ago
Briggs's avatar Briggs

Please move this to a suitable forum, can’t seem to get any help with it!

Situation:

  • EE 1.6
  • FeedGrab (v.0.7.3)
  • Reading 4 feeds from other sites at once via a page setup wtih the FeedGrab code, setup on a cronjob to run every hour
  • Inserting title, link, short description,date into specified weblog, and into 4 categories
  • PHP server time and EE localization time are at the same values now (that was a bugger, had to figure that out!)

  • I have a php variable that has the present time, - 3 hours. I want to compare this time to the entry date of whatever entries have been inserted into the weblog. So, if entry_date > $pastTime, display an icon or asterix. This works! I use php within the weblog entries to show it.

Issue: - Some feeds do not give a specific entry time of each article, while some do. Not having a time value makes it very difficult to compare times - The “pubDate” values are obviously the dates from the feeds, not the actual time that FeedGrab inserted the entry into my weblog. This also makes it very difficult to compare times. - Date formating - i don’t know what should be formatted to a certain date or what should not be, or if it even matters, when it comes down to comparing number values

Solution?: (This is what I need your help with!) The following is the feedgrab plugin code..

{exp:feedgrab url="http://www.yoursite.com/news/rss.php"
weblog="9"
category="7"
title="title"
date="pubDate"
use="link|description"
fields="feed_url|feed_desc"
unique="feed_url"}

What I am hoping someone can help me with, is to find a way to instead of having to use this.

date="pubDate"

I would like to be able to do something that would insert the current time (my server time, which is already setup) of when feedgrab inserted the entry into the weblog, into the date field, instead of the feed items pubDate.

I’ve tried things such as.. (keep in my mind this is not my strong suit)

date="{current_time format="%m/%d/%y %h:%i %a"}"
date="{current_time}"

I have also tried using straight php to insert the current time, but that didnt work either.

I’m sure I’ve screwed the code up somewhere while testing, but the results have always been there are no correct dates inserted into the date field, when I try using any one of those ideas.

Anyone have any ideas?

Thanks

       
Briggs's avatar
Briggs
111 posts
18 years ago
Briggs's avatar Briggs

I have a feeling I’ve stumped the community 😛

EDIT: offset=”<insert some crazy numbers here to altern your entry date>”

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.