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
1
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
1
  • Home
  • Forums

Plugin: FeedGrab

Development and Programming

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

In order for me to get all entries to have entry dates that were all in the same time zone (my servers time zone), this is what 1 of my “grabs” looks like. There are actually 7 of them in this page.

{exp:feedgrab url="http://www.mysite.com/boards/news.xml"
weblog="9"
category="8"
title="title" <----- Invalid value makes FeedGrab insert a default time
date="title"
offset="-21620" <-------- modifies the entry date in seconds so it matches my servers time
use="link|description"
fields="feed_url|feed_desc"
unique="feed_url"}

Also I should mention that I had to play around with the time settings in EE quite a lot. ACross the board I made sure that the time settings were always CDT and always the time zone of my server, even if you are China. Cookies have localized time, but when they are used in a page they are changed to my CDT time (I’m new with cookies, maybe that’s default behaviour). I’m pretty novice in php so I wanted to make sure everything was in the same time so ic oudl play with cookies and date times of entries.

       
allgood2's avatar
allgood2
427 posts
17 years ago
allgood2's avatar allgood2

I’m new to using FeedGrab. Though, I did skim through all six pages of forum comments, I couldn’t find anything that address two questions I have:

(1) Is it possible to declare ‘source’ either to grab it from the feed or hand code it into the {exp:feedgrab} data? I’m looking to pull data from multiple sources, and want to make sure that the source is properly attributed on my site.

(2) Can other plugins be used with the FeedGrab plugin? Mostly I’m interested in stripping HTML, and limited words or characters. For example, one source that we are pulling data from allows full HTML, including style sheet overrides. Since we want the display to be very specific size and format, this isn’t great. I know I can clean it up, specifically on display, with the plugin, I’m just wondering if it could be cleaned before going into the system.

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

You can use other plugins like html strip and what not, but it does not work perfectly, or I have not spent enough time with it yet. Sometimes i get weird character codes. But you can certainly get somewhere with it.

       
allgood2's avatar
allgood2
427 posts
17 years ago
allgood2's avatar allgood2

Yeah, I’ve notice some strange character codes, when I use the plugin on output, but I haven’t tried on input yet. I assume you would wrap it around the source field like:

{exp:feedgrab url="http://www.mysite.com/news.xml"
weblog="1"
title="title"
date="date"
use="link|{exp:html_strip}description{/exp:html_strip}"
fields="feed_url|feed_desc"
unique="feed_url"}
       
Briggs's avatar
Briggs
111 posts
17 years ago
Briggs's avatar Briggs

oh I havnt tried it that way.

I use the html_strip when I am outputting the description in a page.

so

{exp:weblog:entries blah blah}

{exp:html_strip}{exp:word_limit}{feed_desc}{/exp:word_limit}{/exp:html_strip}

{/exp:weblog:entries}
       
allgood2's avatar
allgood2
427 posts
17 years ago
allgood2's avatar allgood2

Whoops, forgot to ask this, what are people doing to make updating the feed automatic? Are you using cron jobs, or placing the feedgrab in silent mode and placing on a high or medium volume template? Anything?

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

I have mine in it’s own template, and cron job it on the server.

       
allgood2's avatar
allgood2
427 posts
17 years ago
allgood2's avatar allgood2
briggs wrote oh I havnt tried it that way. I use the html_strip when I am outputting the description in a page.

Yeah, that’s what I’m currently doing, I was looking for a solution to cleaning the data before it’s entered into the system. That one’s not super urgent though. The entering of source data is more important to me. So I could say this info is from Craigslist, this from the Madison Times, etc, etc.

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

I’m not sure how you are setup, but this is what I do.

I have a weblog with 9 categories. Each category is the source website name.

I then i have 9 chunks of feedgrab code, reading 9 feeds.

for each feed, i assign one of the categories to it. That’s how I ensure the source.. every article is going into the weblog with the assigned category.

Perhaps you are doing something different, i havnt re-read your initial post again (sort of at work, dodging eyes)

The character codes/oddness happening might not have anything to do with html strip, but what the settings are on the custom field where the description is going, but that’s just me guessing. YOu could probably use a find and replace plugin that would catch all the character codes being output as well, maybe. Hmm, I should try that!

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

I’m not sure if you can do some mysql statements or something that would affect the data before you insert it into the weblog database. Might be scary to try.

       
allgood2's avatar
allgood2
427 posts
17 years ago
allgood2's avatar allgood2

Yeah, I thought about categories, but originally dismissed them, perhaps I should revisit. I originally dismissed, because I want to use categories for types of postings. For example, I’ve created custom queries for finding all housing related items located on the East, Near East, and Far East side of Madison. These items can be for rent, for sublet, homes for sale, condos for sale, co-ops, etc. So I was planning on those details to be the categories, and the source, just to be a field called “source”. Obviously source data is part of the feed, so I was hoping I could pull it from there. I’m still going to keep playing. If worse comes to worse, categories can be a fall back.

Thanks for your help.

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

Good luck

(Don’t forget about parent/child categories as well, maybe that will help)

       
Kartar's avatar
Kartar
6 posts
17 years ago
Kartar's avatar Kartar

Any chance you would consider a couple of function requests:

  1. A function to limit the entries created? By date and number perhaps?
  2. A summary function - post multiple RSS entries in a single post - for example all Twtters for a particular day.

Thanks for the great plug-in.

Regards

James Turnbull

       
misc's avatar
misc
54 posts
17 years ago
misc's avatar misc

Category Bug?

I’m using version 0.7.3 and have a problem to add categories (predefined categories using the “category” parameter).

I think there is the following problem in the plugin:

Wrong version:

$results = $DB->query("SELECT cat_id, parent_id FROM exp_categories 
WHERE (cat_id IN ('".implode("','",$cats)."') OR cat_name IN ('".implode("','",$cats)."'))
AND group_id = '".$query->row['cat_group']."'");

Correct version:

$results = $DB->query("SELECT cat_id, parent_id FROM exp_categories 
WHERE (cat_id IN ('".implode("','",$cats)."') OR cat_name IN ('".implode("','",$cats)."'))");

In my case, it works now. But I’m not sure if this is the best way to get it running …

Kind regards, MISC

       
Ludwig Wendzich's avatar
Ludwig Wendzich
47 posts
17 years ago
Ludwig Wendzich's avatar Ludwig Wendzich

Hey,

I’m wanting to include my flickr feed in my tumblelog but currently it’s including each and every photo and I generally upload photos in groups. Each time I upload photos the take up my entire lifestream.

I’d prefer each group of photos I upload to appear as one item in the lifestream. I generally group everything I upload as sets and therefore it makes sense to include every new set as a new item in my lifestream.

I found a yahoo pipe to do this but it doesn’t include the date so my sets are included dateless. Also, the feed created there hasn’t got an images, I’d like 5 random/latest photos from the set to be shown with the entry in the lifestream. So in one field there’s an unorder list with the 5 images in it (for example.)

Thanks a lot!

       
First 6 7 8 9 10 Last

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.