Page 1 of 1
IP Address Visitor
Posted: Mon Dec 29, 2014 3:53 pm
by IdeasVacuum
How can I use SpiderBasic to get the IP address of someone visiting my Website?
Re: IP Address Visitor
Posted: Mon Dec 29, 2014 8:12 pm
by the.weavster
I think SpiderBasic is currently client side only so you'd have to do something like a HTTPRequest() to a PHP script to get it.
You can find the necessary PHP
here.
Re: IP Address Visitor
Posted: Wed Dec 31, 2014 7:35 am
by IdeasVacuum
Thanks for the PHP link. However, PB is effectively client side and it can be used to get the IP address of the User, which is why I thought SB would be similar.
However, given Fred's description of SB, it effectively is more a rival to PB (Fred says it compliments PB), and perhaps as such is not going to be a way to compliment a website. I was hoping to use SB for pop-up forms (visitor info gathering) and messages on my website.
Edit: and to pop-up small applications such as a calculator for engineering.
Re: IP Address Visitor
Posted: Thu Jan 01, 2015 12:41 pm
by the.weavster
IdeasVacuum wrote:However, given Fred's description of SB, it effectively is more a rival to PB (Fred says it compliments PB)
Sure they can be used in a complementary way, for example now PureBasic has JSON commands you could use it to create a
JSON-RPC server and then use SpiderBasic for the front end. More and more HTML5 frameworks are now offering the quality widgets we're used to on desktops, combine those with single page web applications and remote procedure call servers and, certainly within enterprises, you have an efficient way of creating, installing and updating your in-house software.
Re: IP Address Visitor
Posted: Tue Jan 06, 2015 1:15 am
by IdeasVacuum
The following scripts can collect a fistful of useful geo data. In the example below it collects just the IP Address.
To get the results displayed on a web page they are 'bound' to HTML. However, what I need to do is collect them for display in a SpiderBasic Window - so how are they extracted?
Code: Select all
EnableJS
<script src="http://code.angularjs.org/1.2.12/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.12/angular-route.min.js"></script>
<script>
var geo = angular.module('geo', [])
.controller('geoCtrl', ['$scope', '$http', function($scope, $http) {
$http.jsonp('http://ipinfo.io/geo/?callback=JSON_CALLBACK')
.success(function(data) {
$scope.ip = data.ip; //IP address
});
}]);
</script>
DisableJS
Re: IP Address Visitor
Posted: Tue Jan 06, 2015 9:16 am
by Fred
you should be able to use a global SB variable and refere it as "v_YourVariableName" in the JS
Re: IP Address Visitor
Posted: Tue Jan 06, 2015 4:18 pm
by IdeasVacuum
...tried that, nothing doing. The vars are named in the Goggle scripts and the callback uses JSONP, which seems to be impenetrable. Certainly need a way to pass vars to scripts and receive values from them.