예제 #1
0
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Tweets</title>
	<!-- Latest compiled and minified Bootstrap CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

	<!-- Optional Bootstrap theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

	<!-- Custom styles for this template -->
    <link href="/css/custom.css" rel="stylesheet">
</head>

<?php 
require_once 'classes/TwitterWrapper.php';
$TwitterWrapper = new TwitterWrapper();
$username = TWITTER_USERNAME;
//Twitter username to get tweets from
$allTweets = $TwitterWrapper->getAllTweetsfor($username);
$TwitterWrapper->putAllTweetsToDatabase($allTweets);
?>


<body>
	<div class="site-wrapper">
		<div class="site-wrapper-inner">
			<div class="cover-container">
				<div class="masthead clearfix">
					<div class="inner">
						<h3 class="masthead-brand">Tweets</h3>
						<nav>
예제 #2
0
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Tweets</title>
	<!-- Latest compiled and minified Bootstrap CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

	<!-- Optional Bootstrap theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

	<!-- Custom styles for this template -->
    <link href="/css/custom.css" rel="stylesheet">
</head>

<?php 
require_once 'classes/TwitterWrapper.php';
$TwitterWrapper = new TwitterWrapper();
if (isset($_GET['action'])) {
    $id = $_GET['id'];
    if ($_GET['action'] == 'favourite') {
        $TwitterWrapper->addToFavourites($id);
        echo "<h1>Added to favourites</h1>";
    } else {
        if ($_GET['action'] == 'retweet') {
            $TwitterWrapper->retweet($id);
            echo "<h1>Retweeted</h1>";
        } else {
            if ($_GET['action'] == 'answer') {
                echo "<form method='POST' action='index.php/?action=sendtweet&id=" . $id . "'>";
                echo "<p><b>Enter your answer here: </b></p>";
                echo "<textarea class='form-control' rows='3' maxlength='140' name='tweet'>@" . $TwitterWrapper->getUsernameFor($id) . "</textarea>";
                echo "<input class='btn btn-success' type='submit' value='Send'>";