How to implement web-based Anonymity-Tests? - javascript

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.

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

Is it possible to edit and save website content to server, making the change viewable by everyone?

I have created a website for a third party, who have no experience in editing HTML. However, the third party wishes to be able to edit the content on the website without having to open the files and edit it this way, they wish to do it somewhat WYSIWYG (For example, hit an "edit" button for the content they wish to edit). Is this possible to achieve? It is not an internal website, it has user tracking (this should obviously only be available to admin users).
Is there a way of making contents of a div editable, then saving the change directly to the server, so the content gets updated publicly?
I am currently researching the topic, and although I have found some indications that the solution may be a PHP script, I have yet to find any definitive solutions or examples of similar functionality.
Yes you will need a backend language or framework to archive this. Where Javascript is used to interact with the page, the actual storage of information requires a database or similar technology.
Unfortunately which backend language or framework to choose really is the million dollar question. It largely depends on exactly what you are trying to accomplish, what your client or user is comfortable with, and how much experience you have programming.
PHP is fast and time tested backend language. Node is the new kid on the block, and it very popular also. Java and dotNet are on the way out. You can dig up a bunch more including Go, Python, Haskel, Etc.
You can use a languge listed above and start scripting away, but this can be time consuming and error prone. Most people use a framework to get started, and program using that framework's tools. The most popular PHP framework is WordPress, but it is designed for blogs and might not fit your use case. I use the framework Craft CMS which is very customizable. But the way you are phrasing the question a framework might be overkill. This is really up to you to decide after doing research into the available options and comparing them to what you wish to accomplish.
For the WYSIWYG, you might want to look into the following tools for the client to edit content:
https://imperavi.com/redactor/
https://ckeditor.com/
Hopefully this provides some direction, happy coding!

Back-end solution for pure-Javascript site with link sharing

I'm developer-beginner and I would like to do simple card-sorting site.
hundreds of cards with plain text
no log-ins, it must be as simple for user as possible
few dozens users per day
final state of sorting should be saved under unique link, like site.com/q56we1cfuz4 or site.com/link.php?unique=q56we1cfuz4
User sorts cards as he/she wishes and the result is saved into browser sessions storage (few kb of data in JSON or so). So far, so good.
Question:
As I know only Javascript:
If I need to share the state of the page (data in session storage) with some unique link, is something like Firebase.com good solution for such kind of back-end? Or some simple DB with help od Node.js?
In order to "catch" the link when someone click at unique URL (site.com/link.php?unique=q56we1cfuz4), I still need some server-side script which will ask the DB, like PHP header redirect, right?
Your questions are a little fuzzy, no problem tho. You are just getting into web dev, so there's a lot to wrap your head around and all of the options can be pretty confusing. Some people will complain about opinionated answers, and I'm not going to claim to be objective here, but here are a few tips that I think will get you pointed in a better direction...
Firstly, yes - firebase is a good solution for you to try working with. Aside from the fact that it will give you the db/storage features you need, it's a realtime db, which will give you a lot more than just storage in the long run, and will better equip you for the future web development trends. The firebase API is (mostly) designed to work asynchronously, so from a javascript perspective, it falls right in line with the kind of code you'll end up learning to write.
Re: the other aspect of your question - server-side - check out nodeJS. It's basically a server-side javascript platform that will allow you to use the same skills you're learning to write client-side code for the server. Also check out expressJS, a nodeJS package that provides you the http-server, and allows you to handle dynamic urls, etc. - the bits you were thinking about when you made a reference to PHP.
Hopefully this will help you focus on a few specific tools to familiarize yourself with as you learn web development, rather than having to struggle with everything from new languages, platforms, and way too many libraries, frameworks and techniques to wrap your head around. Good luck!

Building location searchable site

Hi there Stack peers!
I am working on creating an apartment review site something along the lines of Apartment Guide. I am EXTREMELY new to coding and to this site so bear with me.
My main question is what are the languages involved in creating a site such as Apartment Guide. I would like to get on learning them ASAP, but first I need to identify the necessary ones.
I am especially looking at the search functionality of the site which allows search by zip, city, apartment name etc. I am thinking the search is a JS function to a sql directory of all the apartments in their database? No idea.
I ran through css and HTML off udemy and codeacademy, I can survive in that field with a reference guide. Right now, I am currently learning JavaScript at the moment but I would like to get more hands on by coding since reading from a 700+ page book isnt sticking quite so well even with notes and the examples. (headfirst into JS by O'reilly).
Again, super new at programming so bear with me.
Thank you in advance!
So far, you have begun to look at the parts of a website that are at the receiving end. HTML, CSS and Javascript are all interpreted by web browsers on the device of the person requesting the resource. You also need to learn how a remote server generates the information for the resource, which can then be passed through the web server to the requester.
You may need to read a few more books before you are through. It is probably too early for you to be focused on the search functionality of your site. There are lots of parts to a web site and most people have their favourite languages/technologies. I like the so-called "LAMP" (e.g. Linux-Apache-MySQL-PHP) stack of technologies, mostly because I found a low barrier to start using them.
Why don't you try learning by setting up a very simple MySQL database on a server, and using a scripting language like php or perl to pull some text out of the database and present it in a web page on a browser.
If you can do this, then you you are handling the "round trip" of sending a request from a browser and getting a response. You can then move on to learning how to send variables along with the request and then have the script act on those variables to modify what is returned to the browser.
You are at the start of a long and fun road. This is not something you will be able to learn in a week. However, fairly soon, my explanation may seem too simple and you will need more details (and have more questions).

Is a database required for a "quiz" type of game?

I don't know much about databases, I've been asking a few questions about them lately to get a better understanding but I'm still a bit confused about what does and doesn't need one.
I'm making a simple application using HTML/CSS/JavaScript, it has a few quizzes and "tutorials" targeted towards children. I don't want the next tutorial/quiz to be unlocked until the previous one is completed.
So for that would I need a database so that it "saves" when one is completed? I don't need to save scores or anything like that, they just get to move on once they get a passing score.
Any other requirements such as saving to a profile or needing to persist between sessions (e.g. changing of device)?
Browsers have localStorage APIs now which allow you to save a lot of the data (and keep it for a set duration of time). There are also good'ol'fashioned cookies which allow you save pieces of information as well.
Keep in mind that both of the above mandate the user use the same browser and allow these mechanisms. Obviously using "private"/"incognito" browsing would also affect saving status.
It's up to what you feel the requirements are.
EDIT Just saw your mention of a mobile app. If you're planning on allowing the experience to transcend devices, you'll need a database. otherwise, you'll be relying heavily on if they use cross-device sync (like Chrome and Firefox do with bookmarks, passwords, etc.)
If you don't mind that people can do a "view source" on the webpage or use every browsers' developer tools to find out the answers or move on to the next tutorial or quiz, then you can use cookies to store the user's status. Or you can use the preferable Web Storage API.
You might want to look at Firebase. Using just simple JavaScript on the web browser, you can have users with logins (or just allow them to login via Facebook or other services) very easily. And then you can store and retrieve data very easily as well, like quizzes, tutorials and results. This way nobody can see the answers even if they're adept at analyzing the webpage.
When you don't use database, before any check, you have to load all data in your static page.
So My sloution: store students situation in a cookie. On each page check cookie status and then use Jquery remove() to remove (Client-side) those parts of page that he/she can not access.
EDIT
This wont work when JavaScript is disabled.
There seems to be a lot of ideas but no clarifying on the database subject.
TL;DR is: No.
Now for the specifics. A database is nothing more than a way to store information. While traditional "SQL" databases (it is pronounced "Sequel" as in "My Sequel" for MySQL) have concepts of tables, where you define columns with items to store and saves each row with its value, much like an Excel file, some databases like Redis store key-value pairs and others lide MongoDB store JavaScript Objects.
You can store information in the source code (As Variables possibly) or in a file. A database is a way to organize that information.
With that said, in your case, you probably need a backend or an API. An API is basically a means of communication with a server through AJAX (JavaScript in the browser asks for stuff). That would be your way to retrieve information from the server as needed, so that users wouldn't see the answers before they answer.
With that out of the way, there are some options. FireBase (As noted on other answer) and AppBase are easy ways to integrate this concept with little effort. But they tie you and your information to their system, and they are mostly targeting more resource intensive apps.
Since you are using JS and seem to be enjoying your learning experience, I would suggest you consider suing NodeJS and defining the data as either a JSON file or a variable in JS. You keep working on your problem but add options and get to learn some stuff.
If you decide to integrate a database and possibly do some neat stuff, you have most of the groundwork done already.
If NodeJS picks your interest, Mean.IO and KrakenJS are, in my opinion, the best places to start, though they may both seem overkill in your specific case.
Do consider though: A database is just a small possible piece in a puzzle, and it's mostly a horrible way to name some of the software that tries to organize your information. Consider first if you need to organize information, and what and how do you need to organize, then start thinking if databases are the best way to organize it.

Categories