Create event before site loads I want to create an event that triggers before the site loads to I grab the variables passed in the http header and send them to a plugin I have made.

I will have a url like http://www.foo.com?username=abc123

I want it immediately trigger a controller method located at: http://www.foo.com/actions/myPlugin/myMethod

Im just not sure how to connect the dots.
Off the top of my head and in no way tested or thought through, you could put some logic in your plugin's init() method:

public function init()
{
    $username = craft()-&gt;request-&gt;getQuery('username');

    if ($username)
    {
        craft()-&gt;urlManager-&gt;setRouteVariables(array(
            'username' =&gt; $username
        ));

        craft()-&gt;runController('myPluginHandle/myPluginActionMethod');
    }
}


Then in your plugins's controller:

class MyPluginController extends BaseController
{
    protected $allowAnonymous = true;

    public function actionDoIt($username)
    {
        // Do your thing.

        $this-&gt;redirect('homepage');
    }
}