require_once dirname(__FILE__) . "/twitter/class.twitter.php";
require_once dirname(__FILE__) . "/classes/mapmyride.php";
require_once dirname(__FILE__) . "/functions.php";
?>
<html>
  <head><title>Updating Users</title></head>
  <body>
      Updating users:
      <ul>
<?php 
mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_DATABASE);
$users = mysql_query("select id,\n    mmr_user_id, \n    app_user_name, \n    app_auth_key,\n    notify_type,\n    last_workout_id, \n    last_update_date from mmr_notify_user where is_active = 1");
while ($row = mysql_fetch_assoc($users)) {
    $workoutCount = 0;
    $mmr = new MapMyRide($row['mmr_user_id']);
    if ($row['last_update_date']) {
        $searchFromTime = strtotime($row['last_update_date']) - 24 * 60 * 60;
    } else {
        $searchFromTime = time() - 24 * 60 * 60 * 2;
    }
    $lastWorkoutId = (int) $row['last_workout_id'];
    foreach (array_reverse($mmr->findWorkoutsSinceTime($searchFromTime)) as $workout) {
        if ((int) $workout->workoutId > (int) $row['last_workout_id']) {
            if ($row['notify_type'] == 'friendfeed') {
                $ff = new FriendFeed($row['app_user_name'], $row['app_auth_key']);
                addWorkoutLinkToFriendFeed($ff, $mmr, $workout->workoutId);
            } else {
                if ($row['notify_type'] == 'twitter') {
                    $twitter = new twitter();
                    $twitter->username = $row['app_user_name'];
<?php

define('MAGPIE_DEBUG', 1);
require_once dirname(__FILE__) . "/../mapmyride.php";
$mmr = new MapMyRide(1746161);
$mmr->fetch_data();
print_r($mmr->workouts);
Ejemplo n.º 3
0
<?php

require_once dirname(__FILE__) . "/friendfeed/friendfeed.php";
require_once dirname(__FILE__) . "/classes/mapmyride.php";
require_once dirname(__FILE__) . "/functions.php";
$mmr = new MapMyRide(1746161);
$mmr->fetch_data();
$ff = new FriendFeed("robdimarco", "lucid129horns");
if ('true' == $_GET['add']) {
    addWorkoutLinkToFriendFeed($ff, $mmr, $_GET['workoutId']);
    header("Location: index.php");
}
$feed = $ff->fetch_user_feed("robdimarco");
?>
<html>
  <head>FriendFeed/MayMyFitness Bridge</head>
  <body>
<?php 
if ($feed) {
    ?>
      <ul>
     <?php 
    foreach ($feed->entries as $entry) {
        ?>
         <li>
             <a href="<?php 
        echo $entry->link;
        ?>
"><?php 
        echo $entry->title;
        ?>