This repository has been archived by the owner on May 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.php
64 lines (43 loc) · 1.5 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
date_default_timezone_set('America/New_York');
require_once('kernel/definitions.php');
require_once('kernel/connection.php');
require_once('kernel/class.user.php');
include_once('smarty/libs/Smarty.class.php');
$user = new User();
$user_data = array( 'name' => 'sLomakov', 'email' => '[email protected]', 'password' => '12345', 'date' => time() );
/*
$id = $user->createUser($user_data);
if ( 0 && !$id ) {
print("User already exists!");
}
*/
echo '<pre>';
$user->getUserByEmail('[email protected]');
$pupkin = new User();
$pupkin->getUserByEmail('[email protected]');
//$user = getUserByEmail('[email protected]');
//print_r($user);
$user->followUser( $pupkin->getId() );
die();
$tweet_data = array( 'message' => 'This tweet message was add at '.date('H:i:s'). ' by '.$user->email, 'time' => time(), 'owner' => $user->id );
$tweet_data_pupkin = array( 'message' => 'This tweet message was add at '.date('H:i:s'). ' by '.$pupkin->email, 'time' => time(), 'owner' => $pupkin->id );
//$user->addTweet($tweet_data);
//$pupkin->addTweet($tweet_data_pupkin);
echo "User: ";
print_r($user);
echo "<br />";
$followers = $user->getFollowers();
echo "Followers: ";
print_r($followers);
echo "<br />";
$following = $user->getFollowing();
echo "Following: ";
print_r($following);
echo "Tweets: ";
$tweets = $user->getTweets(array('by' => TWEETS.'*->time', 'sort' => 'desc', 'limit' => array(0,200), 'self_only' => false ));
print_r($tweets);
// $following
?>