Geo location and reverse geocoding

It’s very easy to get the address data from a website visitor. At first you need the geo location javascript to get the users lat and lng data. After that you can get the address by reverse geocoding using the google maps api.

1. Including JS

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
    <script src="js/geo-min.js"></script>

2. Geo location

if(geo_position_js.init()){
    geo_position_js.getCurrentPosition(success_callback,error_callback);
}
else{
    do something else;
}
function success_callback(p) {
    see 3.
}
function error_callback() {
    alert('error');
};

3. Reverse geocoding

function success_callback(p) {
    var lat = p.coords.latitude;
    var lng = p.coords.longitude;

    // reverse geocoding - get address by lat lng
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(lat, lng);
        geocoder.geocode({'latLng': latlng}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            if (results[0]) {
                document.getElementById('address').innerHTML = '<span>Your address: ' + results[0].formatted_address + '</span>';
            } else {
                document.getElementById('address').innerHTML = '<span>No address found.</span>';
            }
        } else {
            document.getElementById('address').innerHTML = '<span>Geocoder failed due to: ' + status + '</span>';
        }
    });
}

Here you’ll find a working example: geo-location.html

 

New project online: kuechenstud.io

After a long time of planing and working yesterday the new “Küchenstudio” website was launched. Now the 4 podcasts, produced by Philip Banse, have a new home. “Küchenradio”, “Medienradio”, “Studienwahl-TV” and “Datenschau” are now under one platform with the same straight and clear design.

The whole website was done in association with kosmar and we used the “Podlove Podcast Publisher” by eteubert.

My work was to create a WordPress Theme with Podlove Podcast Publisher integration. Setup a Multisite WordpPress installation and migrate all the content from the old websites including comments, ratings etc. One important part was to make sure, that after the launch all old links to media-files, episodes and feeds working well. So at least I configured the rewrite on the old servers.

It’s still something to do but have a look: kuechenstud.io

Küchenstudio

KüchenradioMedienradioStudienwahl.tvDatenschau

Placeholder services for everyone!

Here comes my list of the best online placeholder services. Thanks to @kosmar and @paulchrablass!

1. Highly customizable: cambelt

http://cambelt.co/

cambelt

<img src="ttp://cambelt.co/200x150/Cambelt?color=234653,eeeeee&font_size=24">

Options: format, text, color, size, font-size, text-color, font-family, https, icons

2. Fit and proper by categories: lorempixel

http://lorempixel.com/

lorempixel

<img src="http://lorempixel.com/200/150/city/2/lorempixel" width="200" height="150">

Options: color/greystyle, size, category, image number, text

3. Fit and proper by tags: flickholdr

http://www.flickholdr.com/

flickholdr

 <img src="http:://www.flickholdr.com/200/150/berlin/4">

Options: size, tag, image number

4. The quick and simple way: placehold.it

http://placehold.it/

placehold.it

<img src="http://placehold.it/200x150.png/cccccc/333333&text=placehold.it">

Options: format, text, color, size

5. For dog lovers at random: placedog

http://placedog.com/

placedog.com

<img src="http://placedog.com/200/150" >

Options: color/greystyle, size

6. For cat lovers: placekitten

http://placekitten.com/

placekitten.com

<img src="http://placekitten.com/200/150" >

Options: color/greystyle, size

7. For cute puppy lovers: placepupy

http://placepuppy.it/

placepuppy.it

<img src="http://placepuppy.it/200/150&n=2" >

Options: size, image number, text, text-bg-color, text-color

To be continued!

Frame Killer

A few days ago i found my vegikochbuch.de website under the URL vegikochbuch.eu with some ad-banners and pop-ups and other stuff. After checking the source code i spotted the <iframe> tag thats includes my website.

I found the registrant and the registrar organisation and wrote 2 emails. The registrant dosn’t replied and the organisation can’t help because they are only the domain registrar and the server is somewhere else. What you gonna do about it? I found the answer here: http://en.wikipedia.org/wiki/Framekiller  and these lines of code working perfect for me:

:css
  html { display : none ; }
:javascript
  if( self == top ) {
    document.documentElement.style.display = 'block' ;
  } else {
    top.location = self.location ;
}