Is it possible to change contents dynamically which Alexa skill shows without any user actions? - firebase

I want to create a Photo Frame Skill for Echo Show.
I want to change photos triggered by external server (such as Firebase and so on).
Is it possible to change it dynamically without any user actions?
I saw Notification API and Proactive Events API.
But, These show notifications to user. I don't want to show anythings to user.
I want just trigger controlled from external server to change contents.

The answer depends a lot on the type of skill (for example if it is based on Alexa Conversations or not). But you can try exploring something along this line:
Keep the token of last rendered APL document
Send an APL ExecuteCommand directive from your skill server (https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-interface.html#executecommands-directive)
You can use one of the standard APL commands, depending upon your use case. One option is SetValue command (https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-standard-commands.html#setvalue-command) to modify the background image.

I want to create a Photo Frame Skill for Echo Show
Technically, a skill can last for a maximum of 5min30sec without any user interaction. Only if you provide a prompt that last for 4min then a reprompt that last for 90sec. It could be a blank audio. But Alexa is not suited for custom skills that stays live for a long time without user interactions.

Related

Updating Wordpress Table after a Google Sheet Update

I am currently looking into helping someone using Wordpress and Google Sheets. Essentially, they use Google Sheets data as a backend and Wordpress will display that as a table in a post.
The only issue is this data is refreshed every five mins by an add-on they are using. However, it would be best if the data was updated real time. I am a full stack developer, but not overly familiar with Word Press, is there a way to 1) get the table data to update in real time? Or 2) have the table data loaded on page refresh, like a typical UI to backend service call would?
You can use the wp_update_post() function or the REST API at any time to update the content of any page, or if the table is stored in an option, use update_option().
Then, it's just a matter of whether you want to scan for changes on the server side, or can send a webhook of some kind when the row is updated.
I can think of a few options.
Set up a Cron Job at the server level to check the google sheet for changes, and use either function above to update the table. I don't really recommend that for this because it won't be "live" updates, and may run more (or less) often than it needs to.
See if the "addon" can post the updated row to the WordPress REST api (or custom function handler)
Use one of the Sheets Triggers (onEdit?) in the sheet's Apps Script to fire a remote request to your site with the updated row's value (or the whole sheet?) and update it via the REST API or custom function handler with wp_update_post or update_option.
Use a third party "webhook tool" to hook the Sheet to your site. A tool like Zapier or IFTTT comes to mind.
I'd probably lean towards number 3 as it lets you tie straight into the Google Sheet with Apps Script, and POST just the updated row to your WordPress' site via the API, which provides the following benefits:
• Updates your site "live", as soon as an update is made to the sheet
• Doesn't require server-side set up
• Low amount of data transmitted over the wire
• No needless checks/requests
• No other third-party tools required

Train of thought with submit data Meteor JS

My question is very specific and not for all, I want people to help me with my train of thought.
What I want to build : for example I have service where all people (not logined) can create they post with some data like news and publish it for money.
How I think it should be built (in 2 steps):
Man click on the link to page with form that create posts and router go to this page
He fills data and click submit
Server checked form and if all OK, session.set this data that he fills and route to the next step (pay money
to publish they post)
(I want to build this with stripe so) He clicked on stripe checkout button and pay some $$, if he paid then show message, all ok, we session.get data that he fills from previous step, and on server we insert his post and go it, if not show message that something wrong
Technical Plan session.set session.get, it is right ?
And if someone slip through form with fills and go to payment page, how to check it ? If session.get === undefind or something like this, reroute to previous step ?
As you can see I have a lot of questions, and I cant find answers in google or some documentation tutorials and etc. maybe some have answers to it
Your question is very wide. Consider narrowing it.
Your 2 first points make sense. It's ok. The third and forth are wrong.
Technical Plan session.set session.get, it is right ?
No it is not. You plan to use the information you hold in a Session variable to publish data validated on client side. It does not ensure the validity of your data. This is a bad idea because anyone can open the console and edit the data to make it different/invalid regarding your rules of validation. All it takes is a Session.set ("yourData", "YouHaveBeenHacked");
What you need is to call a Meteor method on server side to add an entry to a dedicated collection. You add another field (e.g; status) to keep track of the post payment and publication and return the data entry _id that you store in a Session variable.
This way, your method can return an error if the data does not fit into your requirements.
Side note: you also need to add a CRON job serverside to get rid of all the old post tentatives that have not been paid for (user left his browser, he closed tab, etc.).

how to turn Google analytics on or off depending on user log in?

I currently have website (vb.net) that uses google analytics and it has been working fine. What i want to do is turn off GA when the employees of my company log in and turn in on when the clients use it. Each login has a unique id so the first thing that i thought of was to just check the id and add/remove the GA code depending on who logs in. I'm not sure if doing this will affect the stats in any way. Are there other ways to achieve this? Thanks
Depending on your use case, it could be better to utilize this data by placing it within a custom variable, saying if the member is an employee or a regular user. Within the reporting you could then segment the traffic based on value. In most cases this will be the better option as you won't have an inflated drop off rate at the login screen.
If you're still needing to abort the calls, you have a few options:
Add the JavaScript window['ga-disable-UA-#######-##'] = true; on the page. This will need to be done before you call the normal Google Analytics code.
Add logic to fire or not include the entire Google Analytics code block if the user is within a certain group or has a certain ID. This will obviously depend on what language you're developing in.

can google analytics tell me http referrer for each specific goal conversion?

I have a website that allows people to create an account (that is the conversion I wish to track).
I wish to know where a specific person is coming from. I have google analytics installed and have set up the registration page as a goal, but the reporting tells me traffic sources as an aggregated pie chart. It doesn't report down to the user account level to say that 'person with email xyz' came from 'facebook' for example.
What custom variables or mark up would I need to add to GA to report at that detailed level, if that is at all possible?
Otherwise, I will just have to record the first http_referer in a cookie and stick it in a database during the registration process.
Any advice?
Firstly I must ask you, how actionable do you think it is to look at data at that granular of a level? Finding out what % of people who registered came from facebook or some other place is actionable, because it helps you do things like determine where to focus marketing efforts. But individual users? How is this actionable to you? (hint: it's not)
However, if you are still determined to know this, you should first note that it is against Google's ToS to record personally identifiable data both directly (recording the actual value in GA) or indirectly (e.g. - recording a unique id that you can use to tie to personal info stored within your own system). If this is something you don't want to risk, I suggest moving to another analytics tool that does not have this sort of thing in their ToS (e.g. Adobe SiteCatalyst, which costs money, or perhaps you may instead prefer to choose an "in-house" approach, like Piwik)
If you are still determined to follow through with this and hope not to get caught or whatever, Google Analytics doesn't record data like what info a visitor filled out in a form (like their email address) unless you populate that data in a custom field/dimension/metric/event to be sent along with the request. Usually you would populate this on the form "thank you" page (which is usually the same page you use as your goal url or goal event if you're popping and using an event for your goal). So you would populate the email address in one of those custom variables and then have it as a dimension to break down the http referrer by.

Shutterfly Order API .

I found this site
http://www.shutterfly.com/documentation/api_OrderImage.sfly
but there are no examples of actually walking through the whole process. Does anyone have any good documentation on using this API to take a local photo and allow someone to order a print via shutterfly?
I went through these steps:
Sign up for an account
Sign up as a developer
Create an application (I called mine Test). Note the generated Application Id and Shared Secret
The Shutterfly API page has a list of references for various Domain-specific APIs:
Address Book
Album Data
Folder Data
Go To Shutterfly UE
Image Upload
Interactive Sign-in
Image Request
Order
Pricing
Seamless Sign-in
User Data
User Authentication
Each uses RESTful principles. The documentation looks pretty comprehensive to me, if you need some background, here's links for RESTful APIs and ROME you may find useful
There is also an API Explorer section on the same page that allows you to test the methods via a form on their site. For example this form for CRUD operations on the album data.
Based on your comment, for your requirements, you would:
Use the Album GET to list albums, then get the data for a specific album.
Use the Image Get request to retrieve the image data, so your friend can verify the image(s) they want to purchase.
Authenticate the user
Use the Pricing POST request to get the estimated pricing for the image.
User the Order POST to submit the order over https
Update: Found a page describing using a Greasemonkey script which adds Shutterfly print ordering capability to Flickr. This might provide the basis for a solution.
For Reference:
The original link above is a middle step of the Shutterfly Open API ordering procedure.
The whole process goes through a series of steps allowing you to control much more than just pushing photos into somebody's album in Shutterfly.
With this process, your application can actually carry out the entire procedure of:
specifying the images and the sizes and quantities, or other products
calculating shipping, taxes, and totals
paying, and
launching the processing
It also includes the ability to see when the packages will be delivered and arrive.
Thus if you have a solid application for mapping your images onto paper and products, you can pretty much control the entire process.
Once the order is submitted, it will appear on the user's account at Shutterfly who the order was associated with.
Kudos to Shutterfly for making such a powerful tool! It would be great if other printing facilities had similar tools.

Resources