Get info from a web page


#1

How to get info from a web page using hubl variables?


#2

Hi @cgrodriguez

What information are you looking to get from your pages? HubL tokens are used to display information on a web page (the full reference for HubL is here), not get data for the page.


#3

Using following code we get information from a blog:

{% set posts = blog_recent_posts('3983717838', 4) %}
{% for content in posts %}
    {{ content.name }}
{% endfor %}

Can I get data from another web site with similar code?


#4

The only data that can be pulled from an external site using HubL would be from an RSS feed. You can use an RSS listing module to display data from any RSS feed (including one from an external site).


#5

We’re using this method but are having issues displaying the featured_image. This is our HubL module implementation:

{% rss_listing "my_rss_listing" rss_url='{{ widget.rss_url }}', publish_date_text='posted at', click_through_text='Read more', show_date=True, include_featured_image=True, overrideable=False, publish_date_format='short', show_detail=True, show_author=True, number_of_items='{{ widget.count }}', is_external=True, title='', label='RSS Listing', limit_to_chars='200', attribution_text='by' %}

This is what our <item> looks like:

...
<item>
      <title><![CDATA[THIS IS THE TITLE]]></title>
      <link>http://www.domain.com/path/to/content/</link>
      <description><![CDATA[This is the description]]></description>
      <media:content url="http://www.imagedomain.com/path/to/image.jpg" type="image/jpeg"/>
      <pubDate>Wed, 14 Sep 2016 16:00:58 -0500</pubDate>
    </item>
...

#6

I am having the same issue with the image. When creating a Custom Module only the title and description shows up, but when using HS preset modules on an email, the image shows up:

  1. Create new EMAIL with RSS feed:
    http://screencast.com/t/UUARl0aSZ

  2. Email RSS module has Title and Description. My image is a DIV inside the RSS description feed and it shows up just fine:
    http://screencast.com/t/I7f7UwvrI2t4

BUT, creating a page template and a custom RSS feed with ncivan example:

Then the image does not show at all: