APIs & Integrations

cgrodriguez
Member

Get info from a web page

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

0 Upvotes
5 Replies 5
cgrodriguez
Member

Get info from a web page

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?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Get info from a web page

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).

HubL supported modules

This page is a comprehensive reference guide of the syntax and the available parameters for all HubL modules.

ncivan
Member

Get info from a web page

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>
...
0 Upvotes
simply180
Member

Get info from a web page

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:

2016-11-10_1206

Shared from Screencast.com

Then the image does not show at all:

2016-11-10_1205

Shared from Screencast.com

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Get info from a web page

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.

0 Upvotes