I have the following JSON response and I'm trying to get given_title
.
{ status: 1,
complete: 1,
list:
{ '890245271':
{ item_id: '890245271',
resolved_id: '890245271',
given_url: 'http://davidwalsh.name/open-graph-data-nodejs',
given_title: 'Get Open Graph Data with Node.js',
favorite: '0',
status: '0',
time_added: '1443782532',
time_updated: '1443784021',
time_read: '0',
time_favorited: '0',
sort_id: 0,
resolved_title: 'Get Open Graph Data with Node.js',
resolved_url: 'http://davidwalsh.name/open-graph-data-nodejs',
excerpt: 'Two of this blog\'s most popular posts are Facebook Open Graph META Tags and How to Create a Twitter Card. I\'m not at all surprised because we as content creators want some visual control over how our site is represented and shared on third party sites, especially social media sites.',
is_article: '1',
is_index: '0',
has_video: '0',
has_image: '0',
word_count: '214' } },
error: null,
search_meta: { search_type: 'normal' },
since: 1444393955 }
This is what I tried in the view
<% data.list.890245271.forEach(function(item) { %>
<p><%= item.given_title %></p>
<% }); %>
But I'm getting an error on the web page Unexpected number in /Users/xxxxx/Dev/Project/views/index.ejs while compiling ejs
I'm obviously doing something wrong here with 890245271
but not sure how to do it right to get what I need.