Troubleshooting Image Problems
May 11, 2009
If you are having problems with images or thumbnails, here are a few steps you can take to troubleshoot the problem. The first thing we need to get out of the way is to make sure you have the boxes checked to copy images locally or create thumbnails and that your post template contains the %image% or %thumbnail% variables. These are the default settings but sometimes those do get changed. Also make sure you have the latest version. Versions 2.3.381 and earlier had problems with image processing on some hosts.
1. Does your theme display images or thumbnails? Some themes only show text excerpts on the index page. A quick theme change can tell you if that is the case.
2. Are there images or thumbnails in your /wp-content/uploads directory? If there aren’t any image files in the directory for the current month, something might be preventing the image files or thumbnails from being saved.
3. Does the post show the image or thumbnail field? If you edit one of the posts that AutoBlogged added, in the custom fields section there should be an Image and/or thumbnail field that contains the URL of the image or thumbnail.
4. Did an error occur? If an error occured during the retrieval of an image, the post might have a custom field named Error that contains the error message received. If you have debug logging enabled, that too might contain additional error information. Your web directory might also contain an error_log file with additional information.
5. Is the feed valid? A surprising number of feeds simply aren’t valid or use non-standard namespaces. You can test your feed at feedvalidator.org. Another good test is to try out several other feeds to see if it is the feed itself that is causing the problem or if the problem occurs with all feeds.
6. Does the feed contain thumbnails? Some feeds may not have attached images although they do show up in the content field. Use the feed in the feed viewer to make sure it even contains images. You may want to try the %content% variable in your post template to get the full encoded content.
…
Tags: autoblog-images image-problems images plugin-support valid-feeds
How to Modify the Title of AutoBlogged Posts
Jan 12, 2010
By default, AutoBlogged uses the original post title as the post for each new WordPress post it creates. However, you can customize how the title appears using our Custom Fields feature.
To do this, create a new custom field named title (note that it is lower case). For the Custom Field Value, you can enter anything you want. What makes this feature so powerful is that you can use the full AutoBlogged Post Template syntax here to include variables, use random values, or even use conditional values.
Here are some examples:
| Custom Field | Custom Field Value |
| title | YouTube Video: %title% |
| title | [Photo|Picture|Image] of the Day |
| title | Latest iPhone App: %title% |
If you have come up with any cool title templates, please comment below, we’d love to see what you have!
Using AutoBlogged with TimThumb and Premium Themes
Feb 20, 2010
AutoBlogged has a built-in thumbnail feature that automatically creates thumbnails for images in posts. However, a number of premium themes use their own scripts such as TimThumb or Viva Thumbs for handling thumbnails. Because these scripts often use the same custom WordPress fields that AutoBlogged uses, you will sometimes see HTML code or an error message in place of the thumbnail image.
AutoBlogged automatically adds the custom fields image and thumbnail that contain the HTML IMG tag to display the image. However, some themes or thumbnail plugins also uses this custom field but expect it to contain a relative path to the image file.
For example, the image custom field might contain something like this:
<img src=”http://example.com/wp-content/uploads/2010/02/xxxxxxxxxx.jpg” />
But your theme expects to see something like this:
/wp-content/uploads/2010/02/xxxxxxxxxx.jpg
Using the AutoBlogged custom fields feature you can easily change the format of the image or thumbnail custom fields to provide the image format you need. You may need to review the documentation for the theme or script to determine which custom field name it is looking for and how it wants image paths formatted.
Using Custom Fields
Depending on how your theme or thumbnail script expects to see the image path, you can use different custom field settings. Below are the three most common cases we see.
Note that depending on your theme or script, you may need to use a different custom field name such as Image, Thumbnail, etc. Keep in mind that in WordPress, case is important so a field named image is not the same as one named Image.
1. The script expects a full HTTP URL to the image
Set up a custom field with these values:
Custom Field: image
Custom Field Value: %image_url%
2. The script expects a file path relative to your web root
First, check the feed setting Save local copies of all images in the feed and uncheck the setting Create local thumbnails for each image. Then set up a custom field with these values:
Custom Field: image
Custom Field Value: %image_path%
3. The script expects a file path relative to the WordPress uploads directory:
First, check the feed setting Save local copies of all images in the feed and uncheck the setting Create local thumbnails for each image.
Next, set up a search and replace with these values:
Search for: /wp-content/uploads/
Replace with: /
Then set up a custom field with these values:
Custom Field: image
Custom Field Value: %image_path%
The Custom Field Value uses the same syntax as post templates, so you can use any variable that you would use there. Here are the image-related variables available:
%image% – The full HTML IMG tag to display an image, for example <img src=”http://farm3.static.flickr.com/2712/xxxxxxxx.jpg” />
%image_url% – The full URL to the image, for example http://farm3.static.flickr.com/2712/xxxxxxxx.jpg
%image_path% – The relative path to the image, normally useful only if you cache images locally, for example /wp-content/uploads/2010/02/xxxxx-150×93.jpg
%thumbnail% – The full HTML IMG tag to display the locally created image thumbnail, for example <img src=”http://example.com/wp-content/uploads/2010/02/xxxxx-150×93.jpg” />
%thumbnail_url% – The full URL to the thumbnail, for example http://example.com/wp-content/uploads/2010/02/xxxxx-150×93.jpg
%thumbnail_path% – The relative path to the thumbnail, normally useful only if you cache images locally, for example /wp-content/uploads/2010/02/xxxxx-150×93.jpg
If you come across any situations where you need to set up custom fields to get your theme or plugins to work correctly, we’d like to hear about them in the comments below.
Accessing Individual Images
May 11, 2009
There are several post template variables you can use in your post template to show images:
%image% – Shows the first image full size
%images% – Shows all images full size
%thumbnail% – Shows a thumbnail of the first image
%thumbnails% – Shows thumbnails of all images
Note that there is also an undocumented feature that will allow you to access individual images. To enable this, open autoblogged.php and find this line near the top of the file:
define(“EXTRA_IMAGE_FIELDS”, false);
If you change the false to true, AutoBlogged will create custom fields for each image that you can use to directly access any image by number. In your post template the variables are %image_1%, %image_2%, %image_3%, etc. If you are accessing them from your theme, the custom fields are image_1, image_2, image_3, etc. We don’t enable this by default because we already add so many custom fields to each post.
We used this feature on one of our demo sites http://idolz.us. If you click on the title of an entry it will take you to the detail page. We modified the theme to show the custom fields thumbnail_1, thumbnail_2, and thumbnail_3.
Release History
Mar 4, 2009
Latest Release: 2.5.74 – August 12, 2009
Change Log
Version 2.6.1 – Jan 16, 2009
- Fixed issue where feeds marked for manual processing were not processing
- Fixed ab_logmsg error
- Fixed implode error with tags
- Fixed image attachments to show up in media library
- Disabled showing of debug log messages on RSS feeds
- Improved processing of custom namespaces
- Fixed WP 2.9 tags box
- Fixed WP 2.9 categories selection
- Added support for DIY Themes
- Added support for Thesis theme
- Improved support for Arthemia theme
- Improved image detection for incorrect MIME types
Version 2.5.74 – August 12, 2009
- Added more debugging code for loading extra files
- Added additional WordPress hooks to fix cron issue
- Added code to handle mysql_real_escape_string failures
- Fixed additional problems with tag and category UI elements
- No longer silently drops mismatched post template variable
Version 2.5.73 – July 30, 2009
- Fixed bug that caused empty URL on RSS feeds
Version 2.5.72 – July 16, 2009
- Fixed Yahoo! API tagging feature
- Fixed ab_logMsg error, improved error handling for logging code
- Changed format of zip file to allow uploading and installing directly from WP
- Updated SQL statement for creating database which caused problems in some environments
- Fixed tags box for WP 2.8 admin panel
- Fixed categories box for WP 2.8 admin panel
- Fixed htmlspecialchars_decode backwards compatibility issue
Version 2.5.61 – June 1, 2009
- Fixed WP 2.8 compatibility
- Fixed implode() error on line 1428
Version 2.5.01 – May 27, 2009
- Added detection of html-encoded image references in feed content.
- Fixed handling of custom namespace elements.
- Misc error handling and debugging fixes.
Version 2.4.25 – April 1, 2009
- Fixed several tagging bugs
- Improved exception handling and debugging
- Fixed double brackets bug when using search/replace
- Fixed long title truncation bug
- Fixed filtering bug with empty filters
- Fixed image and thumbnail custom field bugs with various themes
- Added support for Press75 On Demand theme
Version 2.4.23
- Fixed URL parsing error with PHP4
- Renamed simplepie.inc to simplepie.php
- Changed ALLOW_ALL_TAGS behavior to include all html attributes
- Added additional dupe check based on post name
- Added check for wp_insert_user function and error message for old versions of WP
- Import tags from any media thumbnails
- Fixed PHP4 error: parse_url() expects exactly 1 parameter, 2 given…
- Fixed array_rand error on line 1447.
- Fixed search/replace to also seach video and image fields
- Removed extra custom fields added to each post
- Added support for WPThemesMarket Magazine News theme
- Added support for Press75 themes
- Improved custom RSS module handling to allow hierarchical namespaces
- Fixed last processed and next scheduled times in sidebar in WP 2.7
- Fixed link to modify thumbnail settings in WP 2.7
- Added additional entries to tags.txt and notags.txt files
- Made adjustments to default post template
- Improved WooThemes support
- Custom fields can now override any other field in the post such as Title or Date
- Fixed “Call to a member function get_attribution() on a non-object” error on line 1002
- Fixed bug where category named “Object” appears
- Now assigns only the default category when no category selected for the feed
Version 2.4.22
- Upgraded SimplePie to version 1.1.3
- Fixed fsockopen “Using $this when not in object context” bug
- Added undocumented settings ALLOW_OBJECT_AND_EMBED_TAGS, ALLOW_FORM_TAGS, ALLOW_FRAME_TAGS, ALLOW_SCRIPT_TAGS, ALLOW_ALL_TAGS, ENCODE_INSTEAD_OF_STRIP, FORCE_FEED
- Added code to automatically handle encoded html.
- Remove unmatched variables from post template.
- Fixed broken process and preview links in sidebar in WP 2.7 UI.
- Improved code to identify images in any feed field.
- Added code to block certain images such as stars in youtube feeds.
- Fixed bug with saving images locally when filename is invalid.
- Custom fields now override any value set during post processing.
- Added support for WooThemes.
Version 2.4.19 release candidate
- Fixed version not displaying bug in WP pre-2.7 UI.
- Fixed Missing argument error in WP 2.7.
Version 2.3.418 beta
- Added support for WorPress 2.7 user interface
- Added debug.png icon
- Minor change in handling of debug messages
- Added additional error handling for image_resize
Version 2.3.381 beta
- Added new debugging error messages
- Fixed bug parsing multiple templates
- Fixed bug where %author% variables not populated
- Changed type for search/replace database fields to prevent truncation
- Added additional dupe checking code
- Improved image type verification
- Fixed support request form
- Improved author matching procedure
- Fixed bug parsing two variables with a colon between them in feed template
- Improved video handling, disabled WordPress post filtering
- Improved image handling
- Added image path variable to support Arthemia theme
- Removed page_content from post custom fields
- Fixed Yahoo Tags code
- Post templates now allow literal brackets by using double brackets: [[ and ]]
- Image urls in %content% variable now point to locally cached images
- Made fsockopen errors silent
- Added check for debug.log permissions
- Changed check for updates to occur no more than once every 12 hours
- Comments Off
- Read Entire Post
AutoBlogged Features
May 16, 2008
RSS Feed Sources
- Configure multiple RSS feed sources with the ability to enable or disable individual feeds.
- Support for RSS 0.9, 0.91, 0.92, 1.0, 2.0, and Atom 0.3 and 1.0 feeds.
- Integrated feed caching, HTTP Conditional GET support, and support for GZIP-compression to improve performance and reduce bandwidth usage.
- Support for dozens of RSS modules including Dublin Core, GeoRSS, ITunes, Media RSS, RSS 1.0 Content, W3C WGS84 Basic GEO, XML 1.0, and XHTML 1.0.
- Numerous pre-defined searches to locate articles via Google Blog Search, Technorati, Blogdigger, Blogpulse, MSN Spaces, Yahoo! News, Flickr, YouTube, and others.

- RSS Feed autodiscovery–if you don’t know the exact feed URL, just enter the page address and AutoBlogged will find it for you.
- Built-in feed viewer to help with setting up and troubleshooting feed sources.
- Ability to override the automatically extracted feed data, such as author or source, with your own static values or values.
- Set the default post status to Published, Pending, Draft, or Private
Feed Processing
- Process feeds automatically using built-in pseudo cron feature so an external scheduler is not required.
- Set a range of intervals for random update scheduling.
- Manually process all feeds or one feed at a time.
- Preview feed processing without importing any posts.
- Disable cron operations without disabling the entire plugin.
- Allow other feeds to notify your autoblog of updates using an XML-RPC ping.
- Configure individual feeds to update every time AutoBlogged runs or after every each number of runs you set.

- Include all posts from each feed, set a limit on posts added per feed, or have AutoBlogged select random posts based on a percentage you set.
- Automatically create text-only excerpts based on number of words, sentences, or paragraphs.
Post Filtering
- Domain blacklist blocks posts from certain domains. Excellent way to block sites with spammy content, invalid HTML, or to allow webmasters to exclude their site from your blog.
- Block posts based on any portion of the URL to prevent posts from a specific type of sites such as forums or to block feeds from certain types of software.
- Keyword blacklists to exclude posts that contain keywords you specify.
- Duplicate post checking based on title and/or URL.
- Automatic filtering of malicious content in posts including SQL injection and cross-site scripting.
- Feed-specific filtering based on all words, any words, exact phrase, or none of the words specified.

- Feed-specific search and replace features using regular expressions to rewrite words, URLs, fix invalid content, replace affiliate IDs, etc.
- Truncate or filter out posts with long titles.
- Filter out posts where the titles are in all caps or where they contain multiple consecutive exclamation points or other punctuation.
Categories and Tags
- Assign each feed to one or more blog categories or subcategories or have AutoBlogged randomly select from a list of categories you specify.

- Search each post for existing blog categories and add them as additional categories or as tags on the post.
- Visits the original URL to extract additional tags not found in the feed using our own powerful tagging engine–an important SEO feature that will load your blog with related keywords.

- Add extra tags using the Yahoo! tagging API.
- Include categories from the original post and add missing categories to your blog if you choose.
- Tag blacklists prevent certain tags from appearing on a post.
- Common tags list increases the frequency of popular tags used by Technorati and other tagging sites or modify the list to add important tags for your niche.
- Provide a list of tags to randomly add to each post to increase the density of long tail phrases and other targeted keywords.
- Set the maximum and minimum tag length to ensure consistency and readability of your tags.
- Set the maximum number of tags to add to any post.
Authors
- Specify the author to use for new posts, assign a rando m author or use the name of the original author.
- If the original author does not exist as an author on your blog, add it, skip the post, randomly pick another author, or specify a default author.

- Use additional author information from your blog when adding new posts.
Post Templates
- Post templates let you randomly select from one or more post formats to ensure variety and to accommodate any number of site requirements.
- Apply different post templates to each of your feeds.
- Insert variables from the post, original feed, or any values you define.
- Random Select Lists to add variety to each post.
- Conditional Select Lists to show alternate fields if one is empty.
- Include images, video, flash and other content in your blog posts using an embedded video players.
- Specify a custom player for playing FLV or MP3 files.
- Build custom post templates to use with affiliate and other non-standard feed formats.
- Include text-only summaries or entire feed content as your post.
- Add custom HTML to each post to include NoFollow tags, Javascript, or even WordPress quick tags.
- Custom fields allow you to create your own post variables and include items as additional custom fields fin Wordpress.
- Automatic image, logo, and favicon extraction.
- Include any elements from the original feed based on dozens of supported RSS modules.
- And of course, you can simply show the original feed content untouched.
WordPress Integration
- Takes advantage of internal tagging and category engines to ensure strong keyword coverage and site navigation.
- Full integration with WordPress security and user permission features.
- Attribute posts to WordPress authors when incoming posts use that author’s name.
- Uses site information from WordPress blogroll when that site already exists in your blogroll.
- Automatically adds fields for images, videos, and thumbnails to support a variety of premium themes.
Other Features
- Set the HTTP Referer and User-Agent strings to use when visiting the original sites to advertise your site or provide opt-out instructions or contact info to other webmasters.
- Huge speed and performance improvements over previous versions.
- Commented PHP source code included.
- Support forum and e-mail support for all registered users.
- Free minor version updates included.
System Requirements
- PHP v4.3.2 or later
- WordPress v2.5 or later
- SimplePie Core Plugin v1.1 or later
- PHP cURL extension required
- PHP Zlib extension recommended
Note that servers with safe_mode enabled or an open_basedir set will have reduced image retrieval and tagging capabilities.
- Comments Off
- Read Entire Post
Post Template Reference
May 16, 2008
Post templates are a powerful and flexible feature that allow you to customize how posts appear in your blog. Post templates allow you to randomize the format to give your blog a fresh and natural-looking appearance. You can use post templates to display images, video, flash, audio, custom HTML, or even client-side scripts.
All feeds in AutoBlogged have a default template that will modify the feed and add uniqueness to each post. You can set templates for any feed by editing the details of that feed. The feed syntax described below also works when defining custom fields.
Note that post templates consist of HTML markup so carriage returns and other whitespace is ignored.
Note that the template processing engine does minimal syntax checking so enter your templates carefully and double-check them when you get unexpected results. You can also use this tool to test your templates.
Variables
Inserting Variables
With post templates you can refer to any item in the feed or any information extracted by visiting the original URL.
You can insert variables into your post template by surrounding them with percent signs (%). For example, to insert the current title, use %title% in your template.
Built-In Variables
By default, most feed items will set the following variables that you can insert into your templates:
- %title% – The title of the feed item
- %link% – The unique URL for the original article, often referred to as the permalink or guid.
- %content% – The body of the feed content, which may contain HTML or other markup.
- %excerpt% – A text-only excerpt of the body content.
- %date% - The date the item was published or, if not available, the current date.
Furthermore, many feeds will also provide the following:
- %source% – The source of the feed, such as the web site or blog name.
- %source_url% – The main URL of the feed source.
- %source_description% – Short description of the source web site.
- %author% - The author of the post, if available.
- %copyright% – Any copyright notice included with the feed.
- %copyright_url% – A URL for more copyright information.
- %icon% – The favicon for the source web site.
- %logo_url% - The logo for the source web site.
- %logo_link% – The link to use when making the logo into a hyperlink.
- %logo_title% - The title to use with a logo hyperlink.
- %tags% – All tags assigned to the post.
- %image% – The first image attachment found in feed item returned as a formatted image tag.
- %images% – All image attachments, returned as as a formatted image tag.
- %video% – The first video found in the feed item returned as an embedded flash or video object.
- %videos% – All video attachments, returned as an embedded flash or video object.
If when adding a post the name of the author already exists in your blog, you can also refer the the following variables:
- %author_id% - The WordPress author ID.
- %author_display_name% – The WordPress display name for the author.
- %author_email% – The author’s e-mail address.
- %author_url% – The author’s URL.
You may also use any of the following special variables:
- %original_page% – The full content of the page located by following %link%. Note that this is the raw, unformatted contents of the entire original page and normally will not be useful for using within a template.
- Any other custom field you have set.
Advanced Features
Random Select Lists
You can have the post template randomly select one of a list of items to give your blog a more natural appearance. To do this, use percent signs (%) and brackets ([]) on the outside and pipes (|) between each item.
Syntax:
%[value1|value2|value...]%
Example:
%[Read more|See original|Continue here]%
This will randomly return either Read more, See original, or Continue here.
First Available Lists
Because there are so many feed types and namespace extensions in use, and it is not uncommon to see feeds that do not follow standards, it is possible to work through a list of items until you find one that is not empty.
You can specify a first available list by using percent signs (%) and braces ({}) on the outside and pipes (|) between each item.
Syntax:
%{variable1|variable2|variable…}%
Example:
%{%source%|%author%|%title%}%
This will check the value of the %source% variable. If empty, it will use check the %author% variable and if still empty will use the %title% variable. If all variables are empty the list will return nothing.
Note that in order to provide a default value, set the last item as static text as follows:
%{%source%|%author%|%title%|Source Unknown}%
Note that although you can use variables in First Available lists, you cannot embed nested lists within a list. The same is true for Random Select lists.
Conditional Select Blocks
Conditional select blocks are simple if-then constructs that simply show the enclosed content if the variable is set in the feed. If the variable is not set, AutoBlogged skips the entire block. This is useful to display images or video only if those items exist.
Conditional select blocks contain a tag at the beginning and end of the block, with the conditional content in between.
Syntax:
%if:variable%
content
%endif:variable%
Example:
%if:image% Photo: %image% %endif:image%
The block of code Photo: %image% will only appear if the feed item contains an image.
Loop Blocks
Some item variables may contain more than one value, so all variables that are plural will return a comma-separated list of values. If you wish to customize the display of each value, you can do that with loop blocks.
A loop block will repeat the enclosed content for each value in the variable. When enclosed in a loop block, the plural form of the variable will only return the current item in the loop.
Syntax:
%foreach:variable%
content
%endfor:variable%
Example:
%foreach:images% Photos:<br><%images%> %endfor:images%
This template will repeat the content Photos:<br><%images%> for each image in the feed item. Note that if there are no images in the feed item the content will not be displayed, having the same affect as using a conditional select block.
The default variables that might contain multiple values are %categories%, %tags%, %images%, and %videos%.
Multiple Templates
AutoBlogged allows you to make a list of templates to randomly choose from when adding a post. Place the string <!– template –> between each template as a separator
Example Post Template
Below is a full example of a post template that utilizes many of the elements described on this page:
<p>%excerpt%</p> [Read more here|Read the original here| Read more from the original source| Continued here|Read more|More here]: <a href="%link%" title="%title%">%title%</a> <!--template--> <p>[This is from|Here's %category%-related post from|From] <a href="%sourceurl%" title="%title%">%source%</a>:</p> <blockquote> %excerpt% </blockquote> [Read more|More|Continue here]: <a href="%sourceurl%" title="%category%: %title%">%title%</a> <!--template--> Here's [an interesting|a good|a new] [post|article] from %source%: %excerpt% [Continue|More] here: <a href="%link%" title="%title%">%title%</a>
- Comments Off
- Read Entire Post
DIYThemes Thesis Theme
Nov 14, 2009
Issue
When using the DIYThemes Thesis theme, you may get an error like the following:
Warning: getimagesize() [function.getimagesize]: failed to open stream: No such file or directory in /home/public_html/wp-content/themes/thesis_151/lib/functions/multimedia_box.php on line 158
Problem
AutoBlogged automatically adds a custom field named image to every post it creates. This field contains the HTML code to display an image, including the IMG tag. The Thesis theme also uses a custom field named image that is uses to display thumbnails in various places. If it sees a custom field on a post named image, it will try to process that as an image path.
The problem is that since the AutoBlogged image field contains HTML, Thesis theme will return an error.
Solution
This issue has been fixed in AutoBlogged v2.6 and later. You can download this release here.
Note, however, that this upgrade will not modify existing posts. Unfortunately the only solution to fixing existing posts is to manually edit the custom field for each post so that it only contains the image URL or delete all AutoBlogged posts and start over the feed processing.
Using RSS Custom Namespaces in Post Templates
Oct 1, 2009
One of the things that makes AutoBlogged stand out from other autoblog tools is the powerful Post Templates feature. The Post Template determines how AutoBlogged formats the post it imports into WordPress. Although most users leave the Post Templates at the default settings, many of you have experimented with minor changes to the Post Template to customize your autoblog.
Post Templates support a number of advanced functions that let you customize how AutoBlogged handles a post. There are a number of variables that let you decide what feed items you want to appear in the post. In addition to the basic feed items, AutoBlogged also allows you to access custom namespace elements in an RSS or Atom feed.
Custom namespaces allow feed publishers to add additional feed elements that do not exist in the basic RSS or Atom specifications. Many sites have created custom namespaces to add additional information about the items in their feeds. For example, YouTube adds a namespace that allows them to include additional data such as the user ratings of a video. In a YouTube feed, they first define the namespace at the top of the feed like this:
<feed xmlns:gd=’http://schemas.google.com/g/2005′ >
Then, they refer to the namespace within the feed like this:
<gd:rating average=’4.9114695′ max=’5′ min=’1′ numRaters=’17734′ rel=’http://schemas.google.com/g/2005#overall’/>
We don’t want to go too much into the implementation details in this article, just introduce what custom namespaces are. If you want to learn more about namespaces go here or here.
It is important to note that many publishers simply add new XML elements to an RSS feed without actually declaring namespaces. This is not valid and AutoBlogged will not be able to parse them. If you run into a feed like this, we suggest pointing the publisher to the two links mentioned in the previous paragraph.
Accessing Namespaces
If you have a feed with custom namespaces, you can use them in your post template using the format %namespace:element@attribute% where namespace is the namespace URL or abbreviation, element is the element name, and attribute is an optional attribute of the element. In the YouTube rating example shown earlier, gd is the namespace, rating is the element, and average, max, min, numRaters, and rel are the attributes. Using that example, if you want to show the average rating in your Post Template, use the variable %gd:rating@average%.
If you are feeling a bit confused, below are a number of examples that may better illustrate how to use custom namespaces.
Examples
For our first example, we will take a simplified excerpt from a Yahoo Videofeed:
<item>
<title>Using Custom Namespaces</title>
<description>Using custom namespaces in AutoBlogged Post Templates.</description>
<link>http://video.yahoo.com/watch/……</link>
<pubDate>Sun, 28 Jan 2007 03:00:00 -0800</pubDate>
<media:keywords>autoblogged, autoblog, wordpress</media:keywords>
<media:thumbnail url=”http://l.yimg.com/a/i/us/sch/cn/v/v0/…..jpg />
<media:content type=”application/x-shockwave-flash” medium=”video” lang=”">
<media:player url=”http://d.yimg.com/ht/…” height=”512″ width=”322″ />
</media:content>
</item>
In the above feed, to show the keywords for the video, use the variable %media:keywords%. To include the thumbnail, use %media:thumbnail@url%
Now consider an example from a YouTube feed:
<media:group>
<media:category label=’Music’ scheme=’http://gdata.youtube.com/schemas/2007/categories.cat’>Music</media:category>
<media:content url=’http://www.youtube.com/……’ type=’application/x-shockwave-flash’ medium=’video’ isDefault=’true’ expression=’full’ duration=’334′ yt:format=’5′/>
<media:description type=’plain’>Using custom namespaces in AutoBlogged Post Templates.</media:keywords>
<media:player url=’http://www.youtube.com/watch?v=……’/>
<media:thumbnail url=’http://i.ytimg.com/vi/……/2.jpg’ height=’90′ width=’120′ time=’00:02:47′/>
<media:thumbnail url=’http://i.ytimg.com/vi/……/1.jpg’ height=’90′ width=’120′ time=’00:01:23.500′/>
<media:title type=’plain’>Using AutoBlogged</media:title>
<yt:duration seconds=’334′/>
</media:group>
<gd:rating average=’4.9114695′ max=’5′ min=’1′ numRaters=’17734′ rel=’http://schemas.google.com/g/2005#overall’/>
<yt:statistics favoriteCount=’34363′ viewCount=’4928462′/>
This feed is a bit different because it uses nested elements. In other words, media:content is nested inside the media:group element. Due to a limitation in SimplePie, which we use to process RSS feeds, you must refer to these variables using the full hierarchy with a slash (“/”) between elements. So if you wish to show the media description you would use the variable %media:group/media:description%. If you want to show the duration of the video, you would use the variable %media:group/media:content@duration%.
Note that AutoBlogged currently does not support custom namespaces for attributes, so you would not be able to access the yt:format attribute in the media:content element above. Note also that when there are multiple custom fields with the same name, AutoBlogged will only return the first element it finds.
In addition to custom namespaces, you can specifically refer to certain RSS or Atom elements in a feed using the RSS and Atom namespaces. Consider the following RSS feed excerpt:
<item>
<title>Using Post Templates</title>
<link>http://www.autoblogged.com…….</link>
<guid>http://www.autoblogged.com…….</guid>
<pubDate>Mon, 28 Jul 2008 08:18:51 -0700</pubDate>
</item>
In this feed, you can refer to the guid as %rss:guid% and the pubDate as %rss:pubDate%. With an atom feed you can do the same:
<entry>
<id>http://gdata.youtube.com/feeds/api/videos/……</id>
<published>2005-12-28T03:15:32.000Z</published>
<updated>2009-05-26T12:55:23.000Z</updated>
</entry>
With this feed you can refer to the published date as %atom:published%.
Uncommon Namespaces
Note that in order for AutoBlogged to use a custom namespace abbreviation, it needs to be defined in the modules.php file. If you open the file, you can see that we have already defined most common namespace modules. If you want to use a custom namespace that isn’t listed in that file, you have two options:
1. Edit modules.php to include your custom namespace, following the same format as the other definitions.
2. Always use the full namespace URL when referring to the namespace in your Post Template.
For example, consider this feed excerpt:
<rss version=”2.0″ xmlns:product=”http://www.example.com/schemas/product”>
<channel>
<title>Products Feed</title>
<item>
<title>New Product Announcement</title>
<pubDate>Mon, 28 Jul 2008 08:18:51 -0700</pubDate>
<product:type>Tools</product:type>
<product:price>9.99</product:price>
</item>
</channel>
</rss>
In this example, if you want to use product:type in your Post Template, you can either add the line “product” => “http://www.example.com/schemas/product”, at the end of the list in modules.php and use %product:type% in your Post Template or you can simply use %http://www.example.com/schemas/product:type% in your Post Template without having to modify modules.php.
As you can see, referring to custom namespace elements is a bit of an advanced feature and it does require you to view the raw XML of your feed to find most variable names. However, it is a very powerful feature that can really make your blog stand out from the rest.
Feed processing halts after displaying “Creating thumbnail…”
May 11, 2009
We have encountered a bug that causes AutoBlogged to terminate unexpectedly when trying to create a thumbnail for an image. When creating thumbnails, AutoBlogged calls the WordPress function image_resize which in turn calls wp_load_image which in turn calls the PHP function imagecreatefromstring. All of these functions have proper error handling code, however there is a bug that sometimes causes imagecreatefromstring to halt with a segmentation fault when processing an invalid image.
We do not know the exact details of when and where the problem occurs, but we do know that a number of bugs have been reported related to segmentation faults with imagecreatefromstring. Note that the problem occurs due to an error while processing an image which could mean an invalid image or some other problem. The image may display fine in your browser yet could still be causing the segfault in the GD library.
Unfortunately, being a PHP bug there is nothing we can do to fix this error and because it is a fatal error we cannot just catch it and move on. All we can do is recommend that you check your PHP version to make sure you have the latest release. Otherwise, the only other solution is if you encounter this is to manually skip the post with the invalid image file using the Filtering options to create a URL blacklist or Keyword blacklist entry.
Fortunately this problem is quite rare but we did want to document the issue.



Blog Posts