Skip to content

Commit

Permalink
Added ability to add mmr
Browse files Browse the repository at this point in the history
  • Loading branch information
robdimarco committed Jul 27, 2008
1 parent 3ec9cae commit 66f2450
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/.gitignore
@@ -1 +1 @@
tmp
cache
47 changes: 47 additions & 0 deletions www/index.php
@@ -0,0 +1,47 @@
<?php
require_once dirname(__FILE__) . "/friendfeed/friendfeed.php";
require_once dirname(__FILE__) . "/../classes/mapmyride.php";
$mmr = new MapMyRide(1746161);
$mmr->fetch_data();
$ff = new FriendFeed("robdimarco", "lucid129horns");
$added = false;
if ('true' == $_GET['add']) {
$id = $_GET['workoutId'];
$workout = null;
foreach ($mmr->workouts as $wo) {
if ($wo->workoutId == $id) {
$workout = $wo;
}
}
if (null != $workout) {
$ff->publish_link($workout->title, $workout->link);
}
$added = true;
}
$feed = $ff->fetch_user_feed("robdimarco");
?>
<html>
<head>FriendFeed/MayMyFitness Bridge</head>
<body>
<? if ($added) { ?>Added<?}?>
<? if ($feed) {?>
<ul>
<? foreach ($feed->entries as $entry) { ?>
<li>
<a href="<?=$entry->link?>"><?= $entry->title?></a>
by <a href="<?=$entry->user->profileUrl?>"><?= $entry->user->nickname ?></a>
</li>
<? }?>
</ul>
<?}?>
<? if ($mmr->workouts) {?>
<ul>
<? foreach ($mmr->workouts as $workout) { ?>
<li><a href="<?=$workout->link?>"><?=$workout->title?></a> (<a href="index.php?add=true&workoutId=<?=$workout->workoutId?>">Add</a>)</li>
<? } ?>
</ul>
<?
}
?>
</body>
</html>

0 comments on commit 66f2450

Please sign in to comment.