Creating the Web Client to Consume Your Geo-Location Service

In part three of our geo-location example, we are going to show how to create the web client for the geo-location database and web service hosted on a $5USD/month GoDaddy account. By creating a geo-location database and web service in the previous example, you can create a basic building block to generate all types of geo-location based web hustles to target brothas and sistas or even create bigger global hustles. Think about all the kinds of side hustles you can create with a $5USD/month geo-location hustle. So let’s look at a couple of scenarios here: Food Truck Finder. Create a food truck tracking service where foodie ninjas sign up through their mobile device. So when a food truck is in the area, if the food truck wants to advertise their current location to the people signed up to your food truck finder service, they can pay you $10 via PayPal on your web site. Once the food truck pay, when a foodie ninja check their location, that food truck should return on the listing if it is nearby. You set this hustle up in 15 major cities getting $10 here and there all day long at work while your co-workers talk that MLM and going to get a free Bentley crap. Nearby Business Offers. When brothas and sistas come to Atlanta, they really don’t know where the real spots at and where to go. We can say that for a lot of cities when brothas and sistas get in town, don’t know where to go. Well, that’s where your listing come in where you charge businesses to advertise and you insert their latitude/longitude and then promote offers. Businesses such as night clubs, restaurants, and entertainment venues will always need new people coming in. Again, they use PayPal to pay you, you charge them $100/month and get 200 businesses in multiple cities and you making $20,000/month on top of your job looking at your co-workers listening to online streaming Black radio. Then you realize you can start going worldwide and up your revenue to $200,000 a month still working your day job. Treasure Hunt and War Driving. This is an old popular GPS game similar to that Amazing Race game. For example, you get an expensive handbag and put it at a park. It is Saturday morning and you send a list out to all of the participants who paid $5 entry fee to search for the handbag. You send out a bunch of GPS coordinates for them to run to and get clues to the next destination and eventually the first person who ends up at the winning location gets the handbag. This is your weekend morning side hustle with 50 couples running around and you made $250 on the weekend money to blow at the mall and Red Lobster while other cats are still in bed sleeping. Obviously, there are other hustles you can create such as the airport hustle or run a QR code hustle that gets the current location and offer deals. You can setup this hustle to be in Tokyo, Paris or London and you living in Dayton, Ohio and ish! All of that on some $5USD/month GoDaddy hustle. Getting a Current Location In HTML5, which is supported on both iOS and the latest Android mobile devices, there is a straightforward snippet of JavaScript code that will retrieve your latitude and longitude. Once you have that latitude and longitude, you create the URL in as a REST call in the last example I created and call the web service and get an XML back of the nearest locations that you parse and display. For the HTML code this is what I think it should look like: <!DOCTYPE html> <html> <head> <script src="jquery-1.7.2.min.js"></script> <script type="text/javascript"> jQuery(window).ready(function () { jQuery("#btnGetGeo").click(initiate_geolocation); }); $.ajaxSetup({ cache: false }); var ajax_load = "<img src='img/load.gif' alt='loading...' />"; function initiate_geolocation() { navigator.geolocation.getCurrentPosition(handle_geolocation_query, handle_errors); } function handle_errors(error) { switch (error.code) { case error.PERMISSION_DENIED: alert("user did not share geolocation data"); break; case error.POSITION_UNAVAILABLE: alert("could not detect current position"); break; case error.TIMEOUT: alert("retrieving position timed out"); break; default: alert("unknown error"); break; } } function handle_geolocation_query(position) { jQuery("#txtLocation").val('Lat: ' + position.coords.latitude + ' ' + 'Lon: ' + position.coords.longitude); var loadUrl = 'geolocation.aspx?action=getnearest&latitude=' + position.coords.latitude + '&longitude=' + position.coords.longitude; jQuery("#htmlResult").html(ajax_load).load(loadUrl); } </script> </head> <body> <div><button id="btnGetGeo" >Find my location</button></div> <div><input id="txtLocation" style="width:400px;" /></div> <div id="htmlResult"></div> </body> </html> I copy/paste this stuff off the web in about 15 minutes, actually tested this and it works as expected on the XML web service that I showed you. I’m not going to create this raw example as a demo because I want a better looking demo and that’s where you cats need to tell me what to demonstrate. Do you want me to create a food truck finder example, a business offer example – I won’t do the wardriving stuff, okay because that is too much right now. Or you want me to do the airport hustle and display a QR code that you scan from the web page and get the user current location and show what’s around them? If you look at the code, you should notice the htmlResult is where I display the HTML data list of nearby offers that is stored in the geolocation database. Now I can display a list of food trucks in HTML instead of XML in the code but for the Invisible Pop-Up Store, we can get the XML data because we will also be using other features to determine how to display the object in their mobile device. We still working on that but I know I made a lot of sideline cats mad because they see we about it and how simple it is to do for our people and help them hustle on $5USD/month. See, now you brothas and sistas can go setup a cheap web site, setup your PayPal account, create some local offer site for brothas and sistas using mobile devices and tablets. You can go to the strip clubs and night clubs and other venues and demonstrate on your cheap $100 Android tablet how the local feature work and how people will learn about your company. You can grab one of those cheap .info domain and give it a unique name since no one use those domains for your address. You can do all of that ish before the weekend and start hustling for the summer after Memorial Day while other cats just read this blog and do nothing afterwards. I already know you going to get nutty and start geo-locating ish in Africa, Latin America, Southeast Asia, Middle East and Europe and North America and start taking over worldwide spots catering to multiple demographics and businesses and in different languages. You going to start doing local college offers in college towns and ish, you going to hit up the military installations, you going to hit up tourist attractions and keep collecting deposits from your PayPal while at work and other cats are still looking at these other ignorant stuff on the Internet. So the last article about this geo-location stuff will be a working web example, just need to tell me how to design it.

3 thoughts on “Creating the Web Client to Consume Your Geo-Location Service

  1. Well I’m reading this and partially understanding it. I still don’t know how you would put this into an app. However I do want to start playing with this stuff.

    1. the code above will not go into an “app” but can be used by the iPhone/iPad Safari web browser to do geolocation and also the Android 4.0+ web browser.

      Once we create the database and the web service to return geo-location services, we can run programs from mobile web sites, mobile apps, desktop computers and laptops and so on. The HTML code is just for a web site but we will create an app client for mobile phones if we have to.

  2. Okay, frankly Ed, I read your stuff but never comment because usually they are way over my head. This one though an associate of mines got excited over it and after reading the first parts I got giddy myself also because I see all the possibilities…So I did download the SQL server and inputed your scripts, I am learning how to use the database software on the fly as it is the first time I am exposed to it, I do welcome a challenge though. I already got my windows hosting from godaddy, now I just need to learn how to test the system before proceding.
    All this to say that, I am very into this project!
    Now since nobody has offfered a suggestion how about you do a nearby business example or the airport hustle. I have not slept in the past 3 days but I will master it!
    By the way this whole database thing is very neat and interesting.

Comments are closed.