mailchimp

×

Error message

  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 114 of /home/omahane/coder-notes.com/sites/all/themes/bootstrap/templates/system/table.func.php).
  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 189 of /home/omahane/coder-notes.com/sites/all/themes/bootstrap/templates/system/table.func.php).
  • Warning: count(): Parameter must be an array or an object that implements Countable in bootstrap_table() (line 238 of /home/omahane/coder-notes.com/sites/all/themes/bootstrap/templates/system/table.func.php).

RSS Feed into Drupal Site with SSL

Getting RSS on a Drupal page shouldn't be hard, should it?

We had a request to get a student newsletter that is sent out through MailChimp to appear on a webpage. There was already an RSS feed to the archives, so I just need to bring the content into the site.

Here was the issue, though:

Any Googling for RSS and Drupal brought up messages about importing through Aggregator. The problem with that was that the description in the RSS for MailChimp emails had a whole HTML page in it. It was not really a typical structured feed, but a title, a date and a description with the entire newsletter, including <head> and <body> tags. How was that going to work? I sure didn't know.

The Drupal Mailchimp module was not much better, as it seems to be suited more to managing lists and publishing campaigns, rather than importing old newsletters into the Drupal side.

So then it was off to the RSS widgets which populate the web to see what I could bring in from the feed and render on the page. This was more difficult than it seemed, as any RSS widgets that came up on a Google search only returned those without SSL. Unfortunately, our site has https everywhere, so the iframe kept throwing an error by the XSS auditor.

Thankfully, I found https://feedity.com/tools.aspx. This allowed me to bring in the feed titles and dates and display them in a simple but tasteful way (instead of trying to iframe in the entire newsletter archive, which looked like a big old janky hack).

Here's the resulting page:
https://admissions.creighton.edu/contact-us/student-news-and-events

The good thing about feedity is that it had some simple configuration options that helped:

<script language="JavaScript" type="text/javascript">
<!--
// Customize the widget by editing the fields below
// All fields are required

// Your Feedity RSS feed URL
feedity_widget_feed = "https://feedity.com/yoursite/feedid.rss";

// Number of items to display in the widget
feedity_widget_numberofitems = "5";

// Show feed item description (values: yes or no)
feedity_widget_showdescription = "no";

// Show feed item published date (values: yes or no)
feedity_widget_showdate = "no";

// Widget box width (in px, pt, em, or %)
feedity_widget_width = "250px";

// Widget box background color in hex or by name (eg: #ffffff or white)
feedity_widget_backcolor = "#ffffff";

// Widget text & link color in hex or by name (eg: #000000 or black)
feedity_widget_fontcolor = "#000000";
//-->
</script>
<script language="JavaScript" type="text/javascript" src="https://feedity.com/js/widget.js"></script>

Pretty simple. I set title and date to "yes" and description (which contained an entire newsletter) to "no."

I'm not entirely sure how it works, but the call to the feed and widget.js both use https, so the connection wasn't blocked and the content came across the transom. 

Voila!