+require_once 'trello_config.php';
+require_once 'trello_api.php';
+$days_of_the_week = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
+$months_of_the_year = array('January','February','March','April','May','June','July','August','September','October','November','December');
+$annual_checklist = array('To Do',
+//Checking Account (manual pay)
+$bills_checklist = array('Checking Account' => array('Housing',
+//Credit Card (auto pay)
+'Credit Card' => array('Cell Phone',
+$weekly_checklist = array(array('Exercise the Pooch','Grocery Shopping','Laundry','Language Lessons'),
+array('Exercise the Pooch','Workout','Language Lesson'),
+array('Exercise the Pooch','Workout','Take the garbage/recycle out','Language Lesson'),
+array('Exercise the Pooch','Workout','Language Lesson'),
+array('Exercise the Pooch','Workout','Language Lesson'),
+array('Exercise the Pooch','Workout','Language Lesson'),
+array('Exercise the Pooch','Language Lesson'));
+$grocery_checklist = array('Milk','Chocolate Milk','Fruit','Veggies');
+//figure out what day of the week/month it is
+$date_array = getdate();
+//is it Sunday, first of the month, or 1 December?
+if ($date_array['wday'] == 0 || $date_array['wday'] == 5 || $date_array['mday'] == 1 || ($date_array['mon'] == 12 && $date_array['mday'] == 1))
+ //create Trello instance
+ $trello_instance = new trello_api($key,$secret,$token);
+ if ($date_array['wday'] == 0)
+ 'name' => ('To Do for Week of ' . date('j F Y', strtotime('+1 weeks'))),
+ 'idList' => '//List ID goes here',
+ $card = $trello_instance->request('POST','/1/cards', $card_data);
+ for ($i = 0; $i < 7; $i++)
+ $checklist = $trello_instance->request('POST', '/1/checklists', array('idCard' => $card->id, 'name' => $days_of_the_week[$i]));
+ //push checklist to card
+ foreach ($weekly_checklist[$i] as $checklist_item)
+ $trello_instance->request('POST', ('/1/checklists/' . $checklist->id . '/checkItems'), array('name' => $checklist_item));
+ //If it's Friday, make a grocery list
+ if ($date_array['wday'] == 5)
+ 'name' => ('Grocery List'),
+ 'idList' => '//List ID goes here',
+ $card = $trello_instance->request('POST','/1/cards', $card_data);
+ $checklist = $trello_instance->request('POST', '/1/checklists', array('idCard' => $card->id));
+ //push checklist to card
+ foreach ($grocery_checklist as $checklist_item) {
+ $trello_instance->request('POST', ('/1/checklists/' . $checklist->id . '/checkItems'), array('name' => $checklist_item));
+ //Monthly (First of the Month)
+ if ($date_array['mday'] == 1)
+ //push different quarterly check items to end of Credit Card List
+ if ($date_array['mon'] == 2 || $date_array['mon'] == 5 || $date_array['mon'] == 8 || $date_array['mon'] == 11)
+ array_push($bills_checklist['Credit Card'], "Water Bill");
+ elseif ($date_array['mon'] == 3 || $date_array['mon'] == 6 || $date_array['mon'] == 9 || $date_array['mon'] == 12)
+ array_push($bills_checklist['Credit Card'], "Trash/Recycle");
+ if ($date_array['mon'] == 1 || $date_array['mon'] == 7)
+ array_push($bill_checklist['Credit Card'], "Car Insurance");
+ 'name' => ('Bills, Bills, Bills'),
+ 'idList' => '//List ID goes here',
+ 'due' => date('Y-m-01 12:00 PM', strtotime('+1 month')),
+ $card = $trello_instance->request('POST','/1/cards', $card_data);
+ foreach ($bills_checklist as $bill_list_name=>$bill_checklist)
+ $checklist = $trello_instance->request('POST', '/1/checklists', array('idCard' => $card->id, 'name' => $bill_list_name));
+ //push checklist to card
+ foreach ($bill_checklist as $checklist_item) {
+ $trello_instance->request('POST', ('/1/checklists/' . $checklist->id . '/checkItems'), array('name' => $checklist_item));
+ //Annually (December 1)
+ if ($date_array['mon'] == 12 && $date_array['mday'] == 1)
+ $year = $date_array['year'] + 1;
+ 'name' => ('Annual To Do'),
+ 'idList' => '//List ID goes here',
+ 'due' => $year . '-01-01',
+ $card = $trello_instance->request('POST','/1/cards', $card_data);
+ $checklist = $trello_instance->request('POST', '/1/checklists', array('idCard' => $card->id));
+ //push checklist to card
+ foreach ($annual_checklist as $checklist_item) {
+ $trello_instance->request('POST', ('/1/checklists/' . $checklist->id . '/checkItems'), array('name' => $checklist_item));
+ unset($trello_instance);