How to make registration via API be able only for humans? - service

I making web service (JSON), and web site, which uses this service. And this web site uses service function "register" to register users in web site. And I dont want to make captcha because its boring to type and easy to make mistakes while typing and I just can to loose my customers while registration procedure. So its easy to make application that will register [user00000#haha.com .. user99999#hehe.com] rage of fake accounts. How to avoid this without typing CAPTCHA?
Thanks in advance

There are a few different approaches you can use, or a combination of them:
You can have your users perform basic math instead of the CAPTCHA.
You can also use javascript to detect bots, since bots typically use straight HTTP requests, however client-side javascript requires a real browser in order to execute:
http://www.kalzumeus.com/2010/06/07/detecting-bots-in-javascrip/

There are some nice alternatives to CAPTCHA, for example this and this and this and this (btw, you can find different alternative-CAPTCHAs here - not all of them are "hard" to use!).
Also, there are some alternative CAPTCHAs that instead of displaying twisted characters - give you a simple arithmetic equation, for example: 3+7= and you have to type in the correct result.

Related

Can Squarespace connect to an external Json Rest-API...?

I am new to Squarespace and I was wondering if it can interact with an external Rest-API using JSON?
For example, say I have a Database being hosted privately and I want data from it to be shown via Squarespace and certain pages being restricted according to the user's privileges.
Is any of the above possible, and if so can you direct me to an example? I seem not to be able to find anything on the above via google.
Thanks
From Squarespace:
Squarespace doesn’t support server-side code, including PHP, Ruby, Ruby on Rails, and SQL.
Therefore, the only way to connect to an external API (besides those supported by Squarespace's official 'extensions') is to use "client-side" (in-browser) JavaScript.
So, the database solution which you use must be capable of securely handling client-side connections (for example, Firebase can do that). To interface with it, you must add the JavaScript to your Squarespace site via code block or code injection. An example explanation of doing that can be found at this question.
As to allowing/disallowing content based on data returned from the database, it can be done, but only client-side. That means that, while you can make the site appear to restrict access and/or make it inconvenient for others to access certain pages based on information in the database, because it is all client-side, it could technically be circumvented by someone if they are familiar with web-development, web-inspector, etc. So it's not something you'd want to do if it is critical that the content be truly restricted.
Squarespace does have its own "Members Areas" which can be used to solve content access problems. However, it's extremely limited at the moment, and there are many scenarios it does not address.

How to get feed of Telegram channel

I need to show telegram channel posts in a website. but I don't know how to export telegram channel into xml. I need to have both texts and images and also other files and media like mp4 - pdf or other things.
Is there any way to do that?
In three steps:
First you need create a bot with #botfather. Then add bot to channel. (There is no need to make bot admin.)
Second use a programming language and write a program that receives message from channel and send it to server.
Third you must provide a way in site back-end to receive posts that your program sends.
For second step i suggest you to use python. there are some modules that can deal with bots.i think in your case telepot can be simplest module that do everything you need.
For third step you must add more details about your site back-end. anyway i suggest you to write a Restful API for back-end and send posts to site with python requests module.
You need to use telegram API to access the content of a channel.
Telegram API is fairly complicated. There are clients in different languages that makes it easier to interact with the API.
I personally worked with Telethon and it's relatively simple to get it work. If you follow the directions on the home page, there is also an interactive client you can play around to get yourself familiar with how it works.
If you are familiar with other languages there are clients for those languages as well. If you prefer any specific language please comment.

Can I use protractor not only for testing but for filling a form automatically, if not what can I do?

A friend of mine has to fill online forms every day, and she wonders if there is a way to make this things automatically because she has all the data in a separate file. I showed her protractor, so she asked me if it is possible to use protractor for filling these forms. I think that one is able to use protractor when owns the project, but I don't really know if it is possible to use it when not. If it is not possible to do it, what can I do. I mean what she can do.
In some cases you could, but mostly no. Protractor only appears to work with websites built using AngularJS, however the website does not need to be served locally. The example on the Protractor homepage performs a test on the public/offical AngularJS website:
browser.get('http://www.angularjs.org');
From your own home computer, you can run automated Protractor/Jasmine tests (or other such things) on public websites built with AngularJS. However, you won't be able to perform a Google Search with this method for example, since http://www.google.com does not use Angular.
For more versatile browser automation, you could look at Greasemonkey for Firefox, or Tampermonkey for Chrome. These allow you to write JavaScript which will run in your browser, on top of a particular website, to modify that website's appearance or behaviour.
One other possibility is to write some kind of full automation script, using Python or BASH/curl. Deconstruct the web forms, treat the website effectively like an API, and use HTTP POST to submit form content. However, this would only be effective if your friend uses a select few web forms since it would need to be heavily custom-designed for each form. Also, it would not allow her to manually interact with the website or enter any values. That said, it is probably the most universal and commonly used method of achieving the automation you speak of. Additionally, the website(s) your friend uses might even publish some kind of official documented API, which would make this process far easier.

Sending Data to Website From iPhone

I'm creating an iPhone Game where I want the user to get a unique numeric code when they first launch the app, that way when a friend of that user opens it, he/she can input that code and both users can get rewarded. I haven't encountered any issues regarding that, however what I want to do is make it to where the app registers the code given to every user and saves it to a website of some sort. That way when the other user enters the code, it will load the data from that website and check if it's registered. How would I manage to save the data onto a website? and also What free website could I use for this without having a character limit on the body page?
-Thanks in advance
Your thinking is correct, in that you need to save your data somewhere online, but you don't really "save data onto a website" in the way that you're describing. "Free Website" services usually serve a different purpose entirely - that of serving up public html pages. Sure, they can take the form of a CMS (like wordpress.com or tumblr accounts), but using that as an interface for storing your application's data is not something they're typically designed to do.
For something like this, where you have a public iPhone app that requires secure access to custom strings, you really want to have control over your own web server (different than a domain name, btw), and interface with a database on that server. This will come at a cost, and will involve more code than you're likely to find someone to write for you on here. Sorry to say it, but hey if someone wants to prove me wrong I'd love to see it.
Because all you need to store & retrieve are random strings (basically referral codes... if I'm understanding correctly), your database needs are pretty simple. If you're not familiar with things like PHP / MySQL, and you don't want to learn, it might be worth reaching out to some server-side developers for help. Unless there's more to it than you describe, you can probably find someone to help you for relatively cheap.
Good luck - and I'm sorry there isn't a simpler answer for ya.
You can send data using NSURLConnection. Just create an NSMutableURLRequest and call its -setHTTPMethod: method with “POST” as the HTTP method. Then, set its body and header fields appropriately, and you can use NSURLConnection to send the data.

implementing autocomplete in my website

i am developing a website where i intend to provide the search feature. I am developing it in PHP/MYSQL and i have written the script to perform the search. I wish to provide autocomplete or suggested searches option in the search box as the user types, can i know what are my choices and how can i make use of them?
I had tried YUI Autocomplete, it looks good to me, however i do not understand when it says using a local proxy for the datasource. Can any one help me out here?
Consider trying the Scriptaculous autocomplete. It's very easy to implement.
what does it exactly say on the documentation? (can you provide a link)
by local proxy I would think it means a proxy to a remote web service or API on another domain. (you can't make requests unless scripts are executed on the same domain). http://developer.yahoo.com/javascript/howto-proxy.html
I used jQuery autocompletex