Access google data using javascript - no solid information humans can understand - javascript

I have spent days trying to find any information or working samples on how I can get google data such as emails in my gmail inbox, list of my contacts, my calendar events etc...
None whatsoever :( There are broken pieces of some code fragments here and there, 90% say it's been deprecated, is the a one single page on the internet that gives me a working example how to do that from javascript. Many pages about oAuth, but I have absolutely no idea how to use it , I have spent days reading broken pieces here and there, but I was unable to understand what that it and how I can use it PRACTICALLY. Very sad, and I am very tired to waste so much time on things that dont work and are not documented in human language, possible to understand. Why do they have to overcomplicate thing so much and spread broken pieces of information everywhere?

It's a bit fragmented, but not that hard to get an overview of. Every Google API documentation page has a clear sign stating whether or not the API is deprecated or not.
Anyways, here's a link to the Google Data Protocol (with clear deprecation signs for deprecated APIs). If you follow that path, you should be able to navigate to the APIs that have replaced the old ones as well. I've personally been using the Gdata Python library to populate Google spreadsheets and it's working fine.

Related

How to implement Speech 'Identification' in Javascript (or a Flask WebApp)?

I needed to implement speech 'identification', ie. Guess if the person who is trying to login, is actually him/her, by matching his/her voice.
To consider the case, where the app doesn't recognize the person, but the user is himself trying to login, then he may bypass it with a pin, setup during initial settings.
I am using Python and Flask, to build the webapp, and included javascript in the question, so as to know of possible ways in it too.
Till now, i read about it from some sources, but i couldn't arrive at a possible solution, on stack overflow, as well as 'few' blog posts.
The best 'possible' solution i could arrive at was Cognitive Speech Services by Microsoft -
https://azure.microsoft.com/en-us/services/cognitive-services/speaker-recognition/
I also thought of recording the voice using the Recorder.js, and analyzing at the server end, but couldn't implement it.
So, i wanted a way to implement it on the web app, even a simple gist with a bit of code on using ms cognitive services (i did read pages of the documentation, but it didnt help much), or doing it by python will be helpful.
The documentation at https://learn.microsoft.com/en-us/azure/cognitive-services/speaker-recognition/home will be helpful. Note that there are clickthrough links to the API reference. It explains the high-level process (use “enrollment” to train).
We have speaker identification, which is distinguishing who is speaking from a group of known voices that you train with. You need to provide labelled data (meaning examples of a known speaker talking): see https://westus.dev.cognitive.microsoft.com/docs/services/563309b6778daf02acc0a508/operations/5645c3271984551c84ec6797.
or
Please follow the below link speech SDK samples.
https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/
You can use batch transcription api and enable diarization.
https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/batch-transcription
As #Ram pointed out that we can use the Microsoft Cognitive Services, we used the same to implement it.
First, we needed an API key from Microsoft for the Cognitive Speech Service (they give a 2 keys, and an endpoint for 7 days in a free trial, without any card, and another free version for a year maybe, with card details)
Get the API keys here : https://azure.microsoft.com/en-in/try/cognitive-services/?unauthorized=1
Then, i went through the documentation of Microsoft, but couldn't really be helped by it.
What helped was this : https://github.com/rposbo/speaker-recognition-api
I went through all files, and the 'needed' part was mainly in the speech-recognition-api-demo-core.js and the demo.html
First understand what it's really doing, then only you can implement it on your page.
That actually concludes the answer, since that's how it 'can' be implemented using Javascript.
Extra - https://github.com/AdityaGupta150/ProtoMain - We have used only the needed part of Robin posbo's code (you won't be able to just copy paste, first understand it), and implemented it, you can see that in templates/verification.html

Getting formula from website calculator

So this is an issue I come across frequently... there are many medical website calculators online that health systems would like to use, but the formulas, equations and statistical models aren't readily available. I was wondering if it would be possible to use Developer Tools on chrome or something similar to find these in the javascript? I can find pages of calculations when I mine into the data but nothing that makes sense to me. (EX: http://riskcalculator.facs.org/RiskCalculator/PatientInfo.jsp)
Yes and no. If everything works on the client side you should be able to read the code if you really need it. There's an option to "prettify" the minified script in chrome dev tools (sources -> "{}" icon below the editor).
However, I'm not so sure if reusing it won't violate a law in some countries.
Also, I believe if this is some kind of expensive information, the website authors would rather send input to a server and send back a result. You could also do some reverse engineering by watching the I/O in numerous ways.
I'd suggest writing to them directly first and as if they are willing to share the algorithm with you.
Additionally just do a research on the topic you're interested in. Most of those calculators are using publicly accessible knowledge which is pretty easy to write as a script.

How to parse through Twitch webpage and get list of online streamers

I know this has been done many times before but I am new to the coding scene (relatively new) and love to fiddle around with things. I've never managed to make anything really be functional, as in useful to me. I'm trying to make a chrome extension that shows a list of the online Counter Strike streamers that are currently streaming. I have no idea how to go about this. Is there a way through jQuery to go through this the page and take the first ~10 usernames it find?
I already know how to make the extension and the HTML and all that stuff. Just looking for functionality. I have a list at the moment on an HTML page. There's nothing in the list but I want to fill it with the online streamers. Solely doing this for a "fun" project to get some practice in. So not exactly looking for full answers but someone to point me in the right direction :D.
Completely lost on how to do this. Would regular expressions work?
A mediocre way to do this would be to go into a Twitch page, look for the elements that repeat for each streamer and grabbing the inner HTML, that is, the information on who's streaming.
The proper way to do this would be to go through Twitch's dev API and find information using their dedicated web services and information hooks. Consider it as a way for Twitch to get people invested in their website by providing them easy 'methods' to retrieve things like who's streaming, how many, etc.
I've never used it, but I'm sure it's simple and it's made for this situation.

Google calendar API with a server side account node.js

The title pretty much sums it up.
I'm sorry for asking this question here but i have been going around and around in circles for about 2h now trying to figure out if it is possible to access a calendar's events (simple get, read-only) without the user having to login to a google account?
I am trying to display the events of one calendar to use as an internal thing. But i want this to work without necessarily asking the user to log-in manually.
I have a service account set-up, but for the life of me cannot figure out an example in javascript where this works. And i'm wondering if it is even possible in JS. I know it is possible in java and php. But no examples using javascript seem to exist.
I also saw a few similar cases on stackOverflow, but those cases were looking for refresh tokens. I would like to abstract all authentication from the user.
So, is this possible in javascript?
(Angular.js client-side/Node.js server-side)
Edit for TL;DR
I want to fetch and display events from a google calendar from a node.js server without ANY user intervention. Is this possible?
HAHA! I found something that works.
Install it, create google service-account, download the .p12, convert, enter the info and you're good. Detailed on his github. Calendar stays "private" (only shared to the service account), no user intervention is necessary and it fetches the data fine
(Mostly... Having a problem deploying my js code on a different machine but it works fine on the Windows I used for testing and it's probably a mistake on my part.)

How to implement web-based Anonymity-Tests?

I recently came across some websites that demonstrate which information can be obtained from a user's system and show how 'anonymous' one is. For example these two sites here: http://ip-check.info/?lang=en or http://www.leader.ru/secure/who.html . So I became curious what information actually can be found about a web-user.
1.) Which techniques can be used to gather information about a web-user
From what I noticed they are using JavaScript, Java and Flash to gather all local information they can and send it to the server. Beside that, I'd like to know what other techniques can be used to gather information about the user's system or the user itself.
2.) Where can I find resources to implement an anonymity test
As I haven't done much web-programming I am interested in information and code to get started on an implementation.
Well, one of the sites you listed goes through what it does in detail, so I would start there.

Categories