Example #1
0
 public function beforeSave()
 {
     if (!$this->id) {
         $msg = Yii::app()->user->name . '
     commented on ' . $this->movie->get('name') . '
     "' . $this->comment . '"';
         TwitterPost::send($msg);
     }
     return parent::beforeSave();
 }
Example #2
0
 private function parsePost($entry)
 {
     $post = new TwitterPost();
     $post->setID($entry['id_str']);
     $post->setAuthor($entry['user']['id_str']);
     $post->setCreated(new DateTime($entry['created_at']));
     $post->setBody($entry['text']);
     $post->setParentID($entry['in_reply_to_status_id']);
     return $post;
 }
Example #3
0
<?php

require_once 'TwitterPost.php';
$tweet = new TwitterPost();
$tweet->send();