Setting Up Amazon Alexa Feed with Outbound Feeds
The standard Amazon Alexa block is an out-of-the-box template that uses custom fields to quickly and easily set up, configure and manage your feed.
Feed Setup
The standard Alexa feed is a platform level Arc XP feed block designed to integrate with the Amazon Alexa Flash Briefing Skill. The Alexa feed has some unique requirements imposed by the audio only capabilities of Alexa.
- Alexa will process a maximum of five articles at a time.
- Alexa will play an included mp3 audio file (maximum 10 minutes long). If one isn’t included it will use text to speech to read the article description (maximum 4,500 characters) . Because the text is read, all html tags (including links and images) are striped out. When the content is created, consideration should be given to how it will sound being read aloud.
- Alexa will check for new content every 15 minutes.
Due to the Alexa flash briefing’s unique requirements some sort of curation should be considered. For example using a collection or filtering articles by a specific section or tag. You could also filter for articles that contain an audio element. If an article includes an mp3 audio file it will be played by Alexa, otherwise Alexa will use text to speech on the article body. Care should be taken to keep the articles length with the 4,500 character limit and avoid elements that might not translate to speech well like links, embeds, raw html blocks, and html lists.
Steps to configure the standard Alexa feed.
Enclosure Configuration
Audio URL
Enter the JMESPath statement of the ANS field containing an mp3 audio file, if one should be included. The default is designed for an ANS audio element located in the article body. Currently ArcXP does not provide a tool to add audio content, but audio elements are supported in ANS and can be added manually or via wires. Change the JMESPath configuration to match how your mp3′s are stored. The default will return the first URL in the audio’s streams array element. This assumes there is only one audio element per story.
default: content_elements[?type==’audio’].streams[].url|[0]
Channel Configuration
1. RSS Title
Optional value for Alexa RSS title. Alexa will not use the title, so no Title will be created by default.
default: None
2. RSS Description
Optional value for RSS description. Alexa will not use the description, so no description will be created by default.
default: None
3. RSS Language
Value for RSS language using an ISO-639 value. If left blank it will default to the value of feedLanguage
set in your blocks.json
. The tag can be removed by entering “Exclude” in the field.
default: blank (uses feedLanguage
)
4. Copyright
Optional value for copyright.
default: no copyright
5. Time to Live
Suggested number of seconds that the consumer could cache the results.
default: 1
6. Category
Optional string value for a category to describe the RSS feed.
default: no category
7. Logo URL
Optional fully qualified URL of an image to use as the logo for the RSS feed.
default: no logo
Item Configuration
1. Title
ANS field(s) to use for the article headline, supports a JMESPath statement.
default: headlines.basic
2. Publication Date
ANS date field to display.
Select one: created_date, display_date, first_publish_date, last_updated_date, or publish_date
default: display_date
3. Category
Optional ANS field(s) to use for the article category, supports a JMESPath statement.
default: no category
4. Number of paragraphs to include
Number of paragraphs of the article body to include. Value ranges from 0 to 10, or all
.
default: all
Resolver Configuration
Each feed template needs to have a resolver applied. To Create A Resolver, you’ll want to configure these fields.
1. Resolver Name
Unique name given to the resolver
2. Resolver Priority
Number to indicate priority order regex will be evaluated in (1
to 100
). Lower numbers are evaluated first.
3. Regex Pattern
Because the Alexa feed should be curated, the suggested regex does not follow the standard OBF pattern containing multiple filter patterns.
^/arc/outboundfeeds/alexa/?$
4. URL Parameters
No parameters are needed
5. Websites
all
6. Content Source
feeds-content-api
Optionally you could use a collection to curate articles. The collection content source is available out-of-the-box. It could be used to curate articles for this feed. See the details in the Content Sources with Outbound Feeds article.
Section, Author, Keywords, Tags
If you are using a one of these to filter content, enter the static value in that field
Include - Terms
If you want to use a query to filter for specific content, you can enter a query here. It must be an array formatted like this.
[{"term":{"type": "story"}},{"range":{"last_updated_date":{"gte":"now-2d","lte":"now"}}}]
If you want to limit the feed to only stories with audio you could use the following query.
[{"term":{"type": "story"}},{"term":{"content_elements.type": "audio"}}]
More details on custom queries can be found Here.
Exclude - Terms
If you need to exclude terms in your query, i.e. NOT, enter them here as an array formatted the same as the Include-Terms. For example to exclude all content with language “es” you would use [{“term”:{“language”: “es”}}]
. More details on custom queries can be found Here.
Exclude - Sections
You can enter a comma separated list of sections to exclude.
/premium,/paid-content,/sports/football/premium
Feed - Size
Integer 5. Alexa will process a maximum of 5 articles.
Feed - Offset
Integer. Defaults to 0.
Sort - publish_date:desc
If left blank it will default to publish_date:desc
. The date field you selected to display for the Publication Date is the date you should enter here. If you use a different date, you should use it in as the range in Include-Terms. The format is date_field
+ :
+ sort order
(desc
or asc
). Valid date fields are created_date
, display_date
, first_publish_date
, last_updated_date
, or publish_date
.
Source - Exclude - A comma separated list of ANS fields to remove from the default list of ANS fields. See default list of fields here.
Source - Include - A comma separated list of ANS fields to add to the default list of ANS fields. See the default list here.
Comma separated list of ANS fields to include in the response from Content-API. This is the opposite of Source-Exclude. Use this if you only need a few ANS fields.
Include - Distributor - Name
If you only want content from a single distributor, enter the name here. You may only populate one distributor field.
Exclude - Distributor - Name
If you want to exclude content from a single distributor, enter the name here. You may only populate one distributor field.
Include - Distributor - Category
If you only want content from a single distributor category, enter the name here. You may only populate one distributor field.
Exclude - Distributor - Category
If you want to exclude content from a single distributor category, enter the name here. You may only populate one distributor field.
7. Default Template
Select the Alexa template to apply resolver.
8. Default output type
Select xml
9. Content Mapped Template
blank
RSS URL
To preview your Alexa RSS XML, modify the URL below with the your client org and website name.
https://outboundfeeds.CLIENTORG.arcpublishing.com/pf/arc/outboundfeeds/alexa/?_website=CLIENTWEBSITE NAME
<rss version="2.0"> <channel> <link>http://demo-prod.origin.arcpublishing.com</link> <lastBuildDate>Thu, 17 Jun 2021 15:12:35 +0000</lastBuildDate> <language>en</language> <ttl>1</ttl> <item> <title>Combien de nucléaire, d’éolien, et de solaire en 2050 ? Les six scénarios explosifs de RTE</title> <link>http://demo-prod.origin.arcpublishing.com/news/2021/06/08/combien-de-nucleaire-deolien-et-de-solaire-en-2050-les-six-scenarios-explosifs-de-rte</link> <guid>VDJEYIKPX5DE7IQLRZK2WPRJS4</guid> <pubDate>2021-06-08T15:04:19.625Z</pubDate> <enclosure url="https://cloudfront-us-east-1.audio.arcpublishing.com/demo/P2J3CMTGR5EJZHCL7NG5CWTV3U.mp3" type="audio/mpeg"/> <description>La France s’est donnée pour objectif d’atteindre la neutralité carbone en 2050. Cette ambition suppose de revoir le mix de notre production électrique. Dans cette optique, RTE, le gestionnaire du réseau de transport électrique, a lancé une vaste étude dès 2019. Il publie, ce mardi 8 juin, six scénarios dans lesquels le photovoltaïque, l’éolien et le nucléaire occupent des places plus ou moins importantes. Autant de pistes qui susciteront immanquablement des débats agités.Ces scénarios sont le fruit d’une première phase dite de “cadrage”, ponctuée par une</description> </item> <item> <title>Bitcoin FAQ: A detailed guide to how cryptocurrency works</title> <link>http://demo-prod.origin.arcpublishing.com/news/2021/06/14/bitcoin-faq-a-detailed-guide-to-how-cryptocurrency-works</link> <guid>72Z4WKWC3NBWPG3V3WNPF4QXBA</guid> <pubDate>2021-06-15T01:21:12.837Z</pubDate> <enclosure url="https://cloudfront-us-east-1.audio.arcpublishing.com/demo/P2J3CMTGR5EJZHCL7NG5CWTV3U.mp3" type="audio/mpeg"/> <description>We all know what a dollar bill looks like. We know what a penny looks like. But what about a bitcoin?Cryptocurrencies such as bitcoin, dogecoin and ethereum have risen in popularity in recent years, introducing a host of new terminology and concepts to the public that can be tough to visualize and troubling to understand. A 2017 CNBC poll found that 33 percent of Americans hadn’t seen, read or heard anything about Bitcoin. And 44 percent had said they had seen, read or heard “just some” about it.Yet conversations surrounding cryptocurrencies are becoming increasingly common, especially as ransomware attacks, whose perpetrators demand payments in cryptocurrency, heighten awareness among victimized people, companies and municipalities.On Wednesday, El Salvador became the first country to formally adopt bitcoin as a legal tender in a move that would allow citizens to pay taxes via cryptocurrency. In the United States, the NBA’s Dallas Mavericks and Tesla made announcements this year to accept cryptocurrency for merchandise, although Tesla chief executive Elon Musk later rescinded his comments.</description> </item>
Additional Information
- Steps To Create And Manage Outbound Feeds.
- Optional Content Sources For OBF.
- Using Jmespath To Map To CustomFields ANS Values.
- More details on Resolvers.
- Regex Debugger.