本文整理汇总了PHP中getTwitter函数的典型用法代码示例。如果您正苦于以下问题:PHP getTwitter函数的具体用法?PHP getTwitter怎么用?PHP getTwitter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTwitter函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getSearch
function getSearch($query, $sinceid, $maxid)
{
$t = getTwitter();
$answer = $t->search($query, $sinceid, $maxid);
$resultCount = count($answer->statuses);
if ($resultCount <= 0) {
echo "<div id=\"empty\">No tweet to display.</div>";
} else {
include_once 'lib/timeline_format.php';
$output = '<ol class="timeline" id="allTimeline">';
foreach ($answer->statuses as $status) {
if (isset($status->retweeted_status)) {
$output .= format_retweet($status);
} else {
$output .= format_timeline($status, $t->username);
}
}
$output .= "</ol><div id=\"pagination\">";
$next_results = isset($answer->search_metadata->next_results) ? $answer->search_metadata->next_results : false;
if ($next_results) {
$output .= "<a id=\"more\" class=\"btn btn-white\" style=\"float: right;\" href=\"search.php" . $next_results . "\">Next</a>";
}
$output .= "</div>";
echo $output;
}
}
开发者ID:Hircine,项目名称:embrr,代码行数:26,代码来源:search.php
示例2: actRelation
function actRelation()
{
if (isset($_GET['id'])) {
$t = getTwitter();
if (getEncryptCookie('twitterID') == $_GET['id']) {
echo '<br /><span style="color:#CC0033"><b>同志,你不认得你自己了?</b></span>';
} else {
$reD = $reU = false;
if ($t->isFriend(getEncryptCookie('twitterID'), $_GET['id'])) {
$reD = true;
}
//已关注
if ($t->isFriend($_GET['id'], getEncryptCookie('twitterID'))) {
$reU = true;
}
//被关注
if ($reD && $reU) {
echo '<br /><span class="relSame"><b>和你同一级别</b>
[<a href="javascript:void(0)" class="unfoll_btn">使其成为下级</a>]</span>';
}
if ($reD && !$reU) {
echo '<br /><span class="relUp"><b>是你的上级</b>
[<a href="javascript:void(0)" class="unfoll_btn">与其脱离关系</a>]</span>';
}
if (!$reD && $reU) {
echo '<br /><span class="relDown"><b>是你的下级</b>
[<a href="javascript:void(0)" class="follow_btn">使其成为同级</a>]</span>';
}
if (!$reD && !$reU) {
echo '<br /><span class="relNone"><b>与你无关</b>
[<a href="javascript:void(0)" class="follow_btn">使其成为上级</a>]</span>';
}
}
}
}
开发者ID:BGCX261,项目名称:zlbnc-svn-to-git,代码行数:35,代码来源:getVar.php
示例3: format_timeline
function format_timeline($status, $screen_name, $updateStatus = false)
{
$user = $status->user;
$date = format_time($status->created_at);
$text = formatEntities($status->entities, isset($status->extended_entities) ? $status->extended_entities : null, $status->text);
if (preg_match('/^\\@' . getTwitter()->username . '/i', $text['text']) == 1) {
$output = "<li class=\"reply\">";
} elseif ($updateStatus == true) {
$output = "<li class=\"mine\">";
} else {
$output = "<li>";
}
$output .= '<span class="status_author">
<a href="user.php?id=' . $user->screen_name . '" target="_blank"><img id="avatar" src="' . getAvatar($user->profile_image_url) . '" title="Hello, I am ' . $user->screen_name . '. Click for more..." /></a>
</span>
<span class="status_body">
<span class="status_id">' . $status->id_str . '</span>
<span class="status_word"><a class="user_name" href="user.php?id=' . $user->screen_name . '" id="' . $user->screen_name . '">' . ($_COOKIE['shownick'] == 'true' ? $user->name : $user->screen_name) . '</a> <span class="tweet"> ' . $text['text'] . '</span></span>';
$output .= '<span class="extended_entities">' . $text['extended'] . '</span>';
$output .= "<span class=\"actions\">\n\t\t\t<a class=\"replie_btn fa fa-reply\" title=\"Reply\" href=\"#\"></a>\n\t\t\t<a class=\"rt_btn fa fa-share\" title=\"Quote\" href=\"#\"></a>\n\t\t\t";
if ($user->screen_name != $screen_name) {
$output .= "<a class=\"retw_btn fa fa-retweet\" title=\"New Retweet\" href=\"#\"></a>";
}
$output .= $status->favorited == true ? "<a class=\"unfav_btn fa fa-star-o\" title=\"UnFav\" href=\"#\"></a>" : "<a class=\"favor_btn fa fa-star-o\" title=\"Fav\" href=\"#\"></a>";
if ($user->screen_name == $screen_name) {
$output .= "<a class=\"delete_btn fa fa-trash-o\" title=\"Delete\" href=\"#\"></a>";
}
$output .= "</span><span class=\"status_info\">";
if ($status->in_reply_to_status_id) {
$output .= "<span class=\"in_reply_to\"> <a class=\"ajax_reply\" href=\"ajax/status.php?id={$status->in_reply_to_status_id_str}&uid={$user->id} \">to {$status->in_reply_to_screen_name}</a> </span>";
}
$output .= "<span class=\"source\">via {$status->source}</span>\n\t\t\t<span class=\"date\"><a href=\"status.php?id={$status->id_str}\" id=\"{$date}\" target=\"_blank\">" . date('Y-m-d H:i:s', $date) . "</a></span>\n\t\t\t</span>\n\t\t\t</span>";
$output .= $status->favorited == true ? '<i class="faved fa fa-star"></i>' : '';
$output .= "</li>";
return $output;
}
开发者ID:Hircine,项目名称:embrr,代码行数:36,代码来源:timeline_format.php
示例4: getName
getName();
?>
" height="100" width="100">
</div>
<div id=showInfo>
<b><?php
getName();
?>
</b>
<ul>
<li><a href="<?php
getFacebook();
?>
" target="_blank"><img src="images/facebook-logo-3.png" alt="Facebook link" height="35" width="35"></a> </li>
<li><a href="<?php
getTwitter();
?>
" target="_blank"><img src="images/Twitter-logo-2012.png" alt="Twitter link" height="25" width="30"></a> </li>
<li><a href="<?php
getMixcloud();
?>
" target="_blank" ><img src="images/mixcloud.png" alt="Mixcloud link" height="33" width="33"></a> </li>
</ul>
""<?php
getTagline();
?>
""
</div>
</div>
<div id ="chatBox">
开发者ID:alexanderkell,项目名称:RareFM-Website,代码行数:31,代码来源:index.php
示例5: session_start
<?php
// ver 0.2 by @Chris_Ys
if (!isset($_SESSION)) {
session_start();
}
include_once "../lib/twitese.php";
if (isset($_GET['id']) && isset($_GET['uid'])) {
$t = getTwitter();
$user_id = $_GET['uid'];
$reply_to_id = "";
$html = '<div class="ajax_form round">';
$html .= "<a class=\"close fa fa-times\" title=\"Close\" onclick=\"\$(this).parent().slideToggle(300);return false;\" href=\"#\"></a>";
$html .= '<ol>';
$html .= formatConversation($_GET['id']);
$html .= '</ol></div>';
echo $html;
} else {
echo 'error';
}
function formatConversation($status_id)
{
global $t;
global $user_id;
global $reply_to_id;
$status = $t->showStatus($status_id);
if (!isset($status->user)) {
return "";
}
$user = $status->user;
if ($reply_to_id == "") {
开发者ID:Hircine,项目名称:embrr,代码行数:31,代码来源:status.php
示例6: outpListFollower
function outpListFollower()
{
$t = getTwitter();
if (isset($_GET['max_id'])) {
$twitterdata = $t->listFollowers(getCookie("nUser"), getCookie("nList"), getCookie("nCursor"));
if ($twitterdata === false) {
echo 'error';
} else {
if (count($twitterdata) == 0) {
echo 'none';
} else {
echo builtPerson($twitterdata);
}
}
} else {
$uid = $_GET['id'];
$lid = $_GET['listid'];
$twitterdata = $t->listFollowers($uid, $lid);
if ($twitterdata === false) {
echo builtPlus('error');
} else {
echo '<div id="content">';
echo '<h2>关注' . $uid . '的名单' . $lid . '的是这些人:</h2><br />';
if (count($twitterdata) == 0) {
echo 'none';
} else {
setCookie("nUser", $uid);
setCookie("nList", $lid);
echo builtPlus('headol') . builtPerson($twitterdata) . builtPlus('more');
}
}
}
}
开发者ID:BGCX261,项目名称:zlbnc-svn-to-git,代码行数:33,代码来源:output.php
示例7: actEditProfile
function actEditProfile()
{
$t = getTwitter();
$result = $t->updateProfile($_POST['name'], $_POST['url'], $_POST['location'], $_POST['description']);
if ($result) {
echo 'ok';
} else {
echo 'error';
}
}
开发者ID:BGCX261,项目名称:zlbnc-svn-to-git,代码行数:10,代码来源:postVar.php
示例8: switch
case 'profile':
?>
<span class="subnavLink"><a href="setting.php">Customize</a></span><span class="subnavNormal">Profile</span>
<?php
break;
default:
?>
<span class="subnavNormal">Customize</span><span class="subnavLink"><a href="setting.php?t=profile">Profile</a></span>
<?php
}
?>
</div>
<?php
switch ($settingType) {
case 'profile':
$user = getTwitter()->veverify(true);
?>
<form id="setting_form" action="ajax/uploadImage.php?do=profile" method="post" enctype="multipart/form-data">
<fieldset class="settings">
<legend>Avatar</legend>
<ol>
<li style="display:inline-block"><img src="<?php
echo isset($_COOKIE['imgurl']) ? $_COOKIE['imgurl'] : getAvatar($user->profile_image_url);
?>
" id="avatarimg"></img></li>
<ol style="margin-left:29px">
<li><input type="file" name="image" id="profile_image"/></li>
<li><input type="submit" id="AvatarUpload" class="btn" value="Upload"/><small style="margin-left:10px;vertical-align: middle;">BMP,JPG or PNG accepted, less than 800K.</small></li>
</ol></ol>
</fieldset>
</form>
开发者ID:Hircine,项目名称:embrr,代码行数:31,代码来源:setting.php
示例9: strtoupper
<h2><?php
echo strtoupper(get_sub_field('section_name'));
?>
</h2>
<?php
}
?>
<div class="social-feed">
<div class="feed-container">
<?php
$network = get_sub_field('social_network');
if ($network == 'facebook') {
$social_post = getFacebook(ot_get_option('facebook'));
$suffix = "fb";
} elseif ($network == 'twitter') {
$social_post = getTwitter(ot_get_option('twitter'));
$suffix = "twitter";
}
for ($i = 0; $i < 3; $i++) {
?>
<?php
echo '<a href="' . $social_post[$i]['url'] . '">';
?>
<div class="social-block">
<div class="social-date">
<p><span class='glyphicon glyphicon-<?php
echo $suffix;
?>
'></span><time><?php
echo date("M j", $social_post[$i]['time']);
?>
开发者ID:jrchamp,项目名称:wordpress-template,代码行数:31,代码来源:social.php
示例10: basicBox
return basicBox('/newsletter', '#paper', 'Sign Up for our Newsletter');
}
function getTwitter()
{
return basicBox('https://twitter.com/texansforrubio/', '#twitter', '@TexansForRubio', true);
}
function getMedia()
{
return basicBox('/media', '#image', 'Media from TexansForRubio');
}
function getIssuesBox()
{
return basicBox('/issues', '#image', 'More Issues');
}
function getVolunteerBox()
{
return basicBox('https://docs.google.com/forms/d/1CVsxBpnqCFyoZpGImNmIqYSgDb6ItCT3upl274whsCA/viewform?c=0&w=1', '#hammer', 'Volunteer', true);
}
foreach ($data as $box) {
if ($box === 'newsletter') {
echo getNewsletter();
} elseif ($box === 'twitter') {
echo getTwitter();
} elseif ($box === 'media') {
echo getMedia();
} elseif ($box === 'issues') {
echo getIssuesBox();
} elseif ($box === 'volunteer') {
echo getVolunteerBox();
}
}
开发者ID:adamaoc,项目名称:tfr-mvc,代码行数:31,代码来源:LinkBox.php
示例11: getFacebook
// Facebook example
echo "<h2>Facebook</h2>";
try {
$fb = getFacebook('ncstate', 1);
} catch (Exception $e) {
echo $e->getMessage();
}
foreach ($fb as $post) {
echo "<strong>" . date('M d, y', $post['time']) . "</strong><br/>";
echo $post['message'] . "<br/>";
echo "<a href=" . $post['url'] . ">" . $post['url'] . "</a><br/><br/>";
}
// Twitter Example
echo "<br/><br/><br/><br/><h2>Twitter</h2>";
try {
$twitter = getTwitter("ncstate", 2);
} catch (Exception $e) {
echo $e->getMessage();
}
foreach ($twitter as $tweet) {
$output = "<p><strong>" . date('M d, y', $tweet['time']) . "</strong><br/>" . $tweet['description'];
if ($tweet['media'][0]->media_url) {
$output .= "<br/><img src='" . $tweet['media'][0]->media_url . "' />";
}
$output .= "</p>";
echo $output;
}
// Instagram Example
echo "<br/><br/><h2>Instagram</h2>";
try {
$instagram = getInstagram("ncstate", 10, 'thinkanddo');
开发者ID:ncstate,项目名称:social-sdk,代码行数:31,代码来源:test.php
示例12: header
?>
<span class="subnavLink"><a href="setting.php?t=1">twitese设置</a></span><span class="subnavLink"><a href="setting.php?t=2">外观设置</a></span><span class="subnavNormal">个人设置</span>
<?php
}
}
?>
</div>
<?php
if ($type == 3) {
?>
<?php
if (!isLogin()) {
header('location: login.php');
}
$t = isset($t) ? $t : getTwitter();
$user = $t->showUser();
?>
<form id="setting_form" action="setting.php?t=3" method="post">
<table id="setting_table">
<tr>
<td class="setting_title">昵称:</td>
<td><input class="setting_input" type="text" name="name" value="<?php
echo isset($user->name) ? $user->name : '';
?>
" /></td>
</tr>
<tr>
<td class="setting_title">网站:</td>
<td><input class="setting_input" type="text" name="url" value="<?php
echo isset($user->url) ? $user->url : '';
开发者ID:tianguanghui,项目名称:twitese,代码行数:31,代码来源:setting.php
示例13: getRelationship
function getRelationship($target, $source = false)
{
$relationship = getTwitter()->relationship($target, $source)->relationship;
$target = $relationship->target;
$source = $relationship->source;
$result = 0;
if ($source->muting == true) {
$result |= 8;
}
if ($source->blocking == true) {
$result |= 4;
}
if ($target->following == true) {
$result |= 2;
}
if ($source->following == true) {
$result |= 1;
}
return $result;
}
开发者ID:Hircine,项目名称:embrr,代码行数:20,代码来源:twitese.php
示例14: root
require_once root() . 'controleurs/objetsphp/twitter/controleur_twitterfeed.php';
$script = array("http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js", "javascript/scroll_to_back_to_top.js", "javascript/operations_posts.js");
head('Aaron - Profile', 'Page de profile', 'profile, compte, utilisateur', '', $script);
$fluxArray = array();
$rssurls = getRss($_SESSION['login']);
foreach ($rssurls as $url) {
try {
$feed = new RssFeed($url);
$fluxArray[] = $feed;
} catch (Exception $e) {
echo $e->getMessage() . '<span class="button" id="deletebutton' . $url . '"></span><br/>' . "\n";
continue;
}
}
$fluxTwitArray = array();
$twitAccount = getTwitter($_SESSION['login']);
foreach ($twitAccount as $account) {
try {
$feed2 = new TwitterFeed($account);
$fluxTwitArray[] = $feed2;
} catch (Exception $e) {
echo $e->getMessage() . '<span class="button" id="deletebutton' . $account . '"></span><br/>' . "\n";
}
}
announcement($fluxArray);
$liens[] = '../index.php';
$noms[] = 'accueil';
$images[] = 'static/images/favicon.svg';
$liens[] = '../controleurs/controleur_deconnexion.php';
$noms[] = 'Deconnexion';
$images[] = 'static/images/disconnect.png';
开发者ID:Tixp,项目名称:aaron,代码行数:31,代码来源:vue_profile.php
注:本文中的getTwitter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论