simplepie

Why am I getting memory leaks in SimplePie when using $item->get_permalink()?

扶醉桌前 提交于 2019-12-04 10:07:23
I'm using SimplePie with PHP 5.3 (with gc enabled) to parse my RSS feeds. This works well and without problems when doing something like the following: $simplePie = new SimplePie(); $simplePie->set_feed_url($rssURL); $simplePie->enable_cache(false); $simplePie->set_max_checked_feeds(10); $simplePie->set_item_limit(0); $simplePie->init(); $simplePie->handle_content_type(); foreach ($simplePie->get_items() as $key => $item) { $item->get_date("Y-m-d H:i:s"); $item->get_id(); $item->get_title(); $item->get_content(); $item->get_description(); $item->get_category(); } Memory debugging over 100

SimplePie Pagination / Cache

房东的猫 提交于 2019-12-03 22:47:19
I'm trying to understand the cache'ing features of SimplePie on linux. It never tells us to create a separate mySql database for the RSS feeds, so i'm guessing all the cache is done locally. (in the /httpdocs/ directories ? ) I can't figure out how SimplePie stores it's articles once their imported...(using default install on linux instructions) and how long these articles are stored in the DB. This issue is mostly regarding SimplePie with a simple pagination setup as specified on their site here - http://simplepie.org/wiki/tutorial/how_to_do_item_paging But the thing is, it only keeps a

Pulling posts from another WordPress site

别等时光非礼了梦想. 提交于 2019-12-02 06:32:45
问题 I am trying to get the 2 latest posts from my personal website, using the code below from http://codex.wordpress.org/Function_Reference/fetch_feed#Usage <h2><?php _e( 'Recent news from Some-Other Blog:', 'my-text-domain' ); ?></h2> <?php // Get RSS Feed(s) include_once( ABSPATH . WPINC . '/feed.php' ); // Get a SimplePie feed object from the specified feed source. $rss = fetch_feed( 'THISISWHEREMYURLGOES/' ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) : // Checks that the object is created

Pulling <s:variant> from atom feed with simple pie

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:39:41
问题 How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here. 回答1: You can read the

Pulling posts from another WordPress site

天大地大妈咪最大 提交于 2019-12-02 01:39:32
I am trying to get the 2 latest posts from my personal website, using the code below from http://codex.wordpress.org/Function_Reference/fetch_feed#Usage <h2><?php _e( 'Recent news from Some-Other Blog:', 'my-text-domain' ); ?></h2> <?php // Get RSS Feed(s) include_once( ABSPATH . WPINC . '/feed.php' ); // Get a SimplePie feed object from the specified feed source. $rss = fetch_feed( 'THISISWHEREMYURLGOES/' ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly // Figure out how many total items there are, but limit it to 5. $maxitems = $rss->get_item

How to get DOCUMENT_ROOT to work on both localhost and web host?

梦想的初衷 提交于 2019-12-02 01:28:27
I have a WordPress plugin that I would like to work on localhost as well as in deployment without modification, but I can't seem to set the location for a directory using one statement. I would like to do this: $feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/wp-content/cache'); While that works on the web host. On localhost it produces this error: C:/xampp/htdocs/wp-content/cache/a547b8792c3144c98549be23ef1465e7.spc is not writeable On localhost, I need to set it to this to get it work: $feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/mysite/wp-content/cache'); Surely there must

Pulling <s:variant> from atom feed with simple pie

谁说胖子不能爱 提交于 2019-12-01 23:21:56
How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here . You can read the xml namespace for s from the <feed> tag. <feed xmlns:s="http://jadedpixel.com/-/spec/shopify" xml:lang="en

PHP way of parsing HTML string

你说的曾经没有我的故事 提交于 2019-12-01 18:01:59
I have a php string that contains the below HTML I am retrieving from an RSS feed. I am using simple pie and cant find any other way of splitting these two datasets it gets from <description> . If anyone knows of a way in simple pie to select children that would be great. <div style="example"><div style="example"><img title="example" alt="example" src="example.jpg"/></div><div style="example">EXAMPLE TEXT</div></div> to: $image = '<img title="example" alt="example" src="example.jpg">'; $description = 'EXAMPLE TEXT'; $received_str = 'Your received html'; $html = str_get_html($received_str); /

Get youtube thumbnail simplepie

亡梦爱人 提交于 2019-12-01 14:29:30
So I'm trying to get a thumbnail of a youtube video in simple pie, my problem is that the get_thumbnail() function doesn't seem to be pulling it because the get_enclosure function seems to be returning no values. Is there something that must be done to initialize the simplepie object to get the enclosure properly? Not all feeds support/use RSS enclosures it isn't part of the RSS standard at least not the original RSS standard. It is part of something called MediaRSS . None the less this can be done. Another problem is Google has been changing GData API which is what actually makes the RSS

Get youtube thumbnail simplepie

你。 提交于 2019-12-01 13:07:27
问题 So I'm trying to get a thumbnail of a youtube video in simple pie, my problem is that the get_thumbnail() function doesn't seem to be pulling it because the get_enclosure function seems to be returning no values. Is there something that must be done to initialize the simplepie object to get the enclosure properly? 回答1: Not all feeds support/use RSS enclosures it isn't part of the RSS standard at least not the original RSS standard. It is part of something called MediaRSS. None the less this