Design, Programming, Music and Life

Showing posts with label location. Show all posts
Showing posts with label location. Show all posts

Saturday, October 20, 2012

Proposed solution for the FTC's latest contest.

So the FTC is now offering a reward to the person offering a way to stop telemarketing or robot calls. This may prove to be a bit difficult, but it can be done and I wish I had the funds to work on this. Since I don't though, here is what I'm thinking.

What they would need is not to monitor the content of calls, but the pattern that calls are made. If calls are made in a timed pattern of more than three or four in a row, then we take that number and block all outgoing calls until they can answer a simple spoken word or a math problem over the phone to restore service. This would resemble a system close to the one we use for social networking or chat systems that use a Captcha model to deter bots.

The only way a telemarketing robot could get around this would be to use a new outgoing number after making the max amount of calls per number. Using a triangulation or location based system to detect location, would also help this from happening, because if two or more numbers are found from the same location repeating the same call patterns, it's a bot.

It's a good start at least, and its a solution based on software and not hardware, so there is no need to upgrade existing equipment in order for it to work.

Let me know your thoughts in the comments, Thanks.

Saturday, September 29, 2012

Fun with code: GPS tracking on the cheap

I have set out to learn a bit more about the Google Maps API and how to easily impliment a custom map into Joomla. After looking around quite a bit, I was not able to find anything I could use. What the client wanted was a simple map view showing where his drivers were. The thing about this though, is that they did not want to spend too much $$ on new equipment or GPS fleet tracking software, and he only wanted something simple.

After hours and hours of research and testing, I have found what I think to be the easiest way to impliment multiple KML layers into a single map and I will share my findings with you all too ;) You will need a few things first though, so open up a new browser tab and go install Google Earth if you haven't already. Once you have that, we are ready to get started.


Start by opening up the Google Latitude page, and sign up for a new Google ID per vehicle, biker, etc you want to track, and in Latitude, go ahead and set up a location. Click Privacy Settings, and set that to Detect Your Location. Then tap on the gear in the upper right.
Once you click the gear, choose Advanced Settings. This will open a new screen showing widget embeding options. At the bottom of that page, you will see a Developer Informaion link, click it. and select the KML link.


Now we will go into Google Earth and add that link. Across the top, go to Add, and then Network Link.


Then fill out the info for your location and on the Refresh tab, you can set up your refresh options for the location. It should look something like the dialog here.

Next we want to open a normal Google Maps page, and we will set up our route here. Enter in all the stops on the route, and when done, click Get Directions.
Once finished there, scroll down to the bottom of that left hand colum, and select the Save to My Maps link. Once that opens up, make sure you click the KML link, and save it to your computer somewhere.






We will then open up Google Earth, and open the saved KML file. This will show up in your Map view after imported. Repeat the process how ever many times you need to for trackers and routes, then save the setup as a new KML file by right clicking on the main group, and selecting Save Place As. Then upload the KML file to your server.

Once you have the KML file saved on your server, you will have to create a page to load and show it. Many of the solutions I found online needed a PHP file and an HTML file to function, well I found an easier way for this with just a simple HTML file.

<!DOCTYPE html>
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Maps Example for loading a single KML file, or multiple KML files. </title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
initialize() ;
});
function initialize() {
  var myLatlng = new google.maps.LatLng(42.97112, -85.679208);
  var myOptions = { zoom: 14, center: myLatlng, mapTypeId: google.maps.MapTypeId.TERRAIN}
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  //Route1 Info
  var georssLayerR1 = new google.maps.KmlLayer('http://yourwebsite.com/maps/routes.kml', {preserveViewport: true});
  georssLayerR1.setMap(map);
}
</script>
<body>
  <div id="map_canvas" style="width:100%;height:500px"></div>
</body>
</html>

Once you have this set up, save the HTML file on your server, and you can load it in Joomla by making a simple Wrapper Widget, and setting the URL of the widget to be your saved HTML file.

That's about it for this lesson, if I missed anything, let me know ;)