Skip to content

aziraphale/Location-for-IRC

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
Location-Finder for the Associated PHP-IRC Module
===========================================================

This is a simple Web page that fetches the user's geographical location and then, optionally, stores the result to be reported to IRC by a PHP-IRC bot running the related module.

I originally created this script while I was learning about HTML5's geolocation functionality. It then evolved to allow me to report my location to IRC, which I sometimes use while driving to visit friends (who are also on IRC) - a simple load of a bookmarked Web page will automatically tell those friends where I am (and, therefore, roughly how far away I am from them and they can estimate when they can expect me to arrive).


Configuration
-------------------
Configuring this script is simply a case of changing the array at the top of the script that maps IRC nicks to a temporary file in which to store the location data.


Usage
-------------------
If accessed with no query string (GET arguments), this script simply fetches the user's location and displays it.
If a "name" GET argument is passed, containing an IRC nick set in the $userList array, it will then store that location data in the relevant temporary file to allow the IRC bot to report it.


Known Issues
-------------------
 * No verification is performed on the passed "name", so it is easy to spoof and claim to be someone you're not. This could be alleviated by using arbitrary, long, difficult-to-guess strings as the keys ("nicks") in the $userList array instead of IRC nicks. These keys are not required to match IRC nicks, however the passed "name" GET argument must match whatever has been set as the array key.
 * The script doesn't redirect elsewhere after submitting the location, so if the Web browser is closed (or removed from the running state & memory on mobile devices) and then subsequently re-opened, this page will be re-loaded and the user's location will be again reported, probably unintentionally. This can be fixed by automatically redirecting the page to, for example, a "?name=foo&done" query string after submitting the location, and not submitting the location if the "done" argument is present. A "reload location" button should probably then exist, as well.

About

PHP-IRC module helper HTML5 script to detect a user's location and report it to a PHP-IRC bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages