Call Cortana API from an HTML page - javascript

I wanted to know if there is a way to use the microsoft's cortana api from a web application. Basically to use speech to text for entering text into an input box and do some operations on that. I had tried using the javascript WebSpeechAPI toobut its only for chrome i guess. Any info on the use of cortana api or any other alternatives for a .NET web app will be helpful.
What i found so far -
I know that cortana is supported on UWP (universal windows platform) apps.. so was wondering if there could be a hack to create an api which i could call from the client to invoke cortana and get my work done. there is also a github repo that makes use of a meta tag pointing to a VCD (voice command definition) config file but not sure how to make use of that.
Any help or ideas would be appreciated.
thanks!

Related

Login to a website and scraping its js generated html in android

I am really new to android and I am building an app that will take the username and password of a website(https://lms.mrt.ac.lk).
When the user hits the login button of my android app, the app should itself logged in to the above website and retrieve the complete(including js generated html) html source code.
As a start I tried to print the html source code in the android studio. I tried to use HtmlUnit, but later I found that it is not supported by android. Then, I tried to use Selenium on android, but when tried to build the project it gave me an error "More than one file was found with OS independent path 'META INF' ".
And then tries android's WebView to do the thing, as described in this question, but I don't know how to view the complete html output.
So, my question is -
How to login to a website inside an android app
How to get the complete html source code of the logged in website in android(scraping the js)
I want to do the above in same app. I searched everywhere and still could not find anything complete, that helps a beginner.
Please help me! your suggestions/solutions are highly appreciated.
I'll answer your questions in order.
I don't know what javascript android framework you are using, but the solution should be similar to the java solution. For your specific website, the login endpoint is https://lms.mrt.ac.lk/login.php. You should send a POST request to the endpoint with header parameters LearnOrgUsername and LearnOrgPassword. On success, this should return your desired LoginSessionCookies.
Instead of trying to interpret the javascript stuff, you should rather try to understand how the javascript code retrieves the information you need. And then directly access your information by a web request.

I am trying to integrate Dropbox into my website. What does "curl" mean and how do I use it?

I went on the /list_folders method in the HTTP Developers guide (https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder) and it has "curl" as the example of how to use it. How do I put this in my HTML/JS code to pull in the folders? Thanks!
You can look at the reference for the JavaScript Dropbox library here which will guide you through creating a front-end website that utilizes the API. CURL is a very popular command line script used to transfer data over many supported protocols, but not something you can use from the browser.
More on the Dropbox API, this example Javascript script will show you how to list files.
The partial documentation can be found here.

how to add a button to gmail compose bar using chrome extension

I am new to chrome extension, I want to add a button to Gmail compose bar like this. I tried some of Gmail API to achieve but couldn't find my solution.
If anyone has the idea what will be the approach
You should take a look at gmail-js npm package. It provides a lot of interface to communicate with the Gmail App for your chrome extension. I am currently working on a chrome extension myself that is supposed to work with the Gmail app, and it has made my life so much easier.
Look at the gmail.tools.add_toolbar_button function in the documentation for this particular case.
There are a few things that you need to be careful of though. For example, you can not use the apis this package provides in your content script, you'll have to inject it to the page DOM. The brolierplate example is very helpful to get you started.
Also, the communication between the injected file and content_script can not be done using chrome.runtime API, you will have to use window.postMessage API for that.
Good luck.

How to create a Windows Phone app that parses html data from a website

I'm planning to create a Windows Phone App for my own site (still not up and running).
I don't know how to go about it.
What I know is that I don't want to use the webview control as it would make the app primitive and ugly.
I am thinking of downloading the html content and parsing it into XAML elements to build the app controls.
But, I am a beginner developer and have no experience in this. If anyone could guide me on how to proceed further it would be very helpful.
"I am thinking of downloading the html content and parsing it into XAML elements to build the app controls."
Hell, no!
In my opinion this is the way you should go: your current web app should have calls to services which provide you the data you need to display on the UI. Your web app is a client. Another client could be the Windows Mobile app.
Windows Store apps can be developed using HTML5+JS or C#+XAML. Pick one way, you know best.
Just saying, if you have some REST service behind everything, it will help you out build clients with ease.
I used AngleSharp to parse html and construct XAML elements based on that.
https://github.com/AngleSharp/AngleSharp
"I don't want to use the webview control as it would make the app primitive"
This is that you believe. It's possible it's because you have not knowledge enough.
You can make beautiful apps with html. More this if your are trying only make a web as app.
Try making php get_contents and calling that from ajax. Into the app you can style the data you parsed
If you have web application, you have two easy ways to convert it to mobile:
Cordova
Hosted Web App
But Cordova uses webview, so probably you want to use second option:
You can create app by wrapping existing web site:
Click “File -> New Project” and choose “JavaScript -> Windows ->
Windows Universal -> Blank App (Windows Universal)”
I think it's much easier than designing XAML application.

Box api for JS / Cordova app

i'v spend some time investigating if i can integrate JS app (Cordova app) with Box v2 API. I would like to receive a list of file or folders. I'm not able to find a working example for JS. Is is possible at all? Are you aware of any example?
You can take a peek at their native suggestion, https://developers.box.com/authentication-in-your-ios-app/. But if you're going to use it just inside Cordova, you will probably have to use their Oauth set-up to get credentials, https://developers.box.com/oauth/, then you can issue requests to the API for info on any part of the user's account.

Categories

Resources