コード例 #1
0
ファイル: getMentions.php プロジェクト: sspssp/twitter_list
use TwitterOAuth\TwitterOAuth;
date_default_timezone_set('UTC');
require_once __DIR__ . '/vendor/autoload.php';
include "config/config.php";
$tw = new TwitterOAuth($config);
$conf = new Lib\Conf();
//Last ID
$lastid = $conf->getValue("lastid");
//Get Screenname
if ($conf->getValue("screenName") === False) {
    echo "Get Screenname\r\n";
    $response = $tw->get("account/settings");
    $screenName = $response->screen_name;
    $conf->setValue("screenName", $screenName);
}
$lists = new Lib\Lists();
if ($lastid !== false) {
    $response = $tw->get('statuses/mentions_timeline', array("since_id" => $lastid));
} else {
    $response = $tw->get('statuses/mentions_timeline', array());
}
# Loop Tweets
foreach ($response as $tweet) {
    # Set lastid if tweet id is bigger
    if ($tweet->id_str > $lastid) {
        $lastid = $tweet->id_str;
    }
    #Tweet Pharsen
    list($listname, $entrys) = $lists->tweetPhrasen($tweet->text);
    if (!$lists->checkNewUser($tweet->user->id_str)) {
        $lists->addUser($tweet->user->id_str);
コード例 #2
0
ファイル: longkey.php プロジェクト: sspssp/twitter_list
<?php

include "../vendor/autoload.php";
include "../config/config.php";
$lists = new Lib\Lists();
$longkey = $lists->getLongKey($_GET["key"]);
header("Access-Control-Allow-Origin: *");
if ($longkey === false) {
    echo '{"status":"fail"}';
} else {
    echo '{"status":"ok", "resData": "' . $longkey . '"}';
}
コード例 #3
0
ファイル: lists.php プロジェクト: sspssp/twitter_list
<?php

ini_set("display_errors", 1);
session_start();
$_SESSION["longkey"] = "nokey";
if (isset($_GET["longkey"])) {
    $_SESSION["longkey"] = $_GET["longkey"];
}
include "../vendor/autoload.php";
include "../config/config.php";
$lists = new Lib\Lists();
if (!$lists->checkLongKey($_SESSION["longkey"])) {
    echo "Account nicht gefunden";
    exit;
}
$userid = $lists->getUserID($_SESSION["longkey"]);
$listen = $lists->getListen($userid);
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
  <div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Listservice</h1>
  </div>
コード例 #4
0
ファイル: rm.php プロジェクト: sspssp/twitter_list
<?php

ini_set("display_errors", 1);
session_start();
include "../vendor/autoload.php";
include "../config/config.php";
$lists = new Lib\Lists();
$userid = $lists->getUserID($_SESSION["longkey"]);
if (!is_numeric($userid)) {
    echo '{"status":"no user id"}';
    exit;
}
$entrys = explode(",", $_GET["rm"]);
foreach ($entrys as $entryid) {
    if (is_numeric($entryid)) {
        if ($lists->getOwner($entryid) == $userid) {
            $lists->rmEntry($entryid);
        } else {
            echo '{"status":"wrong user id"}';
            exit;
        }
    }
}
?>
{"status":"ok"}
コード例 #5
0
ファイル: liste.php プロジェクト: sspssp/twitter_list
<?php

ini_set("display_errors", 1);
session_start();
$_SESSION["longkey"] = "nokey";
if (isset($_GET["longkey"])) {
    $_SESSION["longkey"] = $_GET["longkey"];
}
include "../vendor/autoload.php";
include "../config/config.php";
$lists = new Lib\Lists();
if (!$lists->checkLongKey($_SESSION["longkey"])) {
    echo "Account nicht gefunden";
    exit;
}
$userid = $lists->getUserID($_SESSION["longkey"]);
$listen = $lists->getListEntrys($userid, $_GET["liste"]);
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
  <div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Listservice</h1>
  </div>
コード例 #6
0
<?php

use TwitterOAuth\TwitterOAuth;
date_default_timezone_set('UTC');
require_once __DIR__ . '/vendor/autoload.php';
include "config/config.php";
$tw = new TwitterOAuth($config);
$conf = new Lib\Conf();
//Last ID
$lastid = $conf->getValue("lastid");
$lists = new Lib\Lists();
$entrys = $lists->getShortKeys();
foreach ($entrys as $entry) {
    #$user = $tw->get("users/lookup", array("user_id"=>$entry["userid"]));
    #$username = $user[0]->screen_name;
    $tw->post("direct_messages/new", array("user_id" => $entry["userid"], "text" => "Dein Key ist " . $entry["shortkey"] . ""));
    $lists->createLongKey($entry["userid"]);
    #var_dump($user);
}