本文整理汇总了PHP中Posts::post方法的典型用法代码示例。如果您正苦于以下问题:PHP Posts::post方法的具体用法?PHP Posts::post怎么用?PHP Posts::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Posts
的用法示例。
在下文中一共展示了Posts::post方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
public static function search($p = array('is_tag_prefix' => false, 'lang' => 'all', 'include_keyword_matches' => false, 'include_entities' => false, 'enable_keyword_aggregation' => false, 'enable_influencer_aggregation' => false, 'enable_domain_aggregation' => false, 'enable_monthly_aggregation' => false, 'enable_weekly_aggregation' => false, 'enable_daily_aggregation' => false, 'count' => 25, 'page' => 0, 'sort' => 'date'))
{
$posts = new Posts();
$p = $posts->addCustomerKey($p);
$posts->checkRequiredParams($p, array('keywords'));
// Sanitize default values
$p['is_tag_prefix'] = $posts->convertBool($p, 'is_tag_prefix');
$p['include_keyword_matches'] = $posts->convertBool($p, 'include_keyword_matches');
$p['include_entities'] = $posts->convertBool($p, 'include_entities');
$p['enable_keyword_aggregation'] = $posts->convertBool($p, 'enable_keyword_aggregation');
$p['enable_influencer_aggregation'] = $posts->convertBool($p, 'enable_influencer_aggregation');
$p['enable_domain_aggregation'] = $posts->convertBool($p, 'enable_domain_aggregation');
$p['enable_monthly_aggregation'] = $posts->convertBool($p, 'enable_monthly_aggregation');
$p['enable_weekly_aggregation'] = $posts->convertBool($p, 'enable_weekly_aggregation');
$p['enable_daily_aggregation'] = $posts->convertBool($p, 'enable_daily_aggregation');
$p['include_brand_content'] = $posts->convertBool($p, 'include_brand_content');
$p['include_shared_content'] = $posts->convertBool($p, 'include_shared_content');
// support for multi params
$p['keywords'] = is_array($p['keywords']) ? implode(',', $p['keywords']) : $p['keywords'];
if (isset($p['influencers'])) {
$p['influencers'] = is_array($p['influencers']) ? implode(',', $p['influencers']) : $p['influencers'];
}
if (isset($p['tags'])) {
$p['tags'] = is_array($p['tags']) ? implode(',', $p['tags']) : $p['tags'];
}
if (isset($p['exclusion_keywords'])) {
$p['exclusion_keywords'] = is_array($p['exclusion_keywords']) ? implode(',', $p['exclusion_keywords']) : $p['exclusion_keywords'];
}
if (isset($p['root_urls_inclusive'])) {
$p['root_urls_inclusive'] = is_array($p['root_urls_inclusive']) ? implode(',', $p['root_urls_inclusive']) : $p['root_urls_inclusive'];
}
if (isset($p['root_urls_exclusive'])) {
$p['root_urls_exclusive'] = is_array($p['root_urls_exclusive']) ? implode(',', $p['root_urls_exclusive']) : $p['root_urls_exclusive'];
}
return $posts->post(TraackrApi::$apiBaseUrl . 'posts/search', $p);
}
示例2: Posts
$posts = new Posts($auth);
$posts->getPosts();
print $posts->printOutput();
} else {
if (isset($_GET["get"]) && $_GET["get"] == "media") {
$media = new Media($auth);
$media->getMedia();
print $media->printOutput();
} else {
if (isset($_POST['changepass'])) {
$auth->changePassword();
print $auth->printOutput();
} else {
if (isset($_POST["comment"])) {
$posts = new Posts($auth);
$posts->post();
print $posts->printOutput();
} else {
if (isset($_POST["deleteid"])) {
$utils = new Utils($auth);
if (isset($_POST["deleteid"]) && $_POST["deleteid"] != "" && is_numeric($_POST["deleteid"])) {
$id = $_POST["deleteid"];
$utils->deleteComment($id);
print $utils->printOutput();
} else {
$utils->setOutput(self::$FAIL, "id is missing or invalid");
}
} else {
if (isset($_GET["get"]) && $_GET["get"] == "profile") {
$profile = new Profile($auth);
$profile->get();