Ajout de l'affichage des account et contest dans l'app
This commit is contained in:
@@ -129,26 +129,95 @@ class APIController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function follow($user, $follow)
|
||||
public function follow($user, $tweetid)
|
||||
{
|
||||
$stack = $this->Oauth1($user);
|
||||
|
||||
// Créer le client Guzzle avec le handler stack
|
||||
$client = new Client([
|
||||
'base_uri' => 'https://api.twitter.com/1.1/',
|
||||
'base_uri' => 'https://api.twitter.com/graphql/',
|
||||
'handler' => $stack,
|
||||
'proxy' => [
|
||||
'http' => 'http://xtjnmwvl-'.$user->id.':lp7iv1lq9glu@p.webshare.io:80',
|
||||
]
|
||||
]);
|
||||
|
||||
$params = [
|
||||
"variables" => [
|
||||
"referrer" => "profile",
|
||||
"includeTweetImpression" => true,
|
||||
"includeHasBirdwatchNotes" => false,
|
||||
"isReaderMode" => false,
|
||||
"includeEditPerspective" => false,
|
||||
"includeEditControl" => true,
|
||||
"focalTweetId" => $tweetid,
|
||||
"includeCommunityTweetRelationship" => true,
|
||||
"includeTweetVisibilityNudge" => true,
|
||||
],
|
||||
"features" => [
|
||||
"longform_notetweets_inline_media_enabled" => true,
|
||||
"super_follow_badge_privacy_enabled" => true,
|
||||
"longform_notetweets_rich_text_read_enabled" => true,
|
||||
"super_follow_user_api_enabled" => true,
|
||||
"unified_cards_ad_metadata_container_dynamic_card_content_query_enabled" => true,
|
||||
"super_follow_tweet_api_enabled" => true,
|
||||
"articles_api_enabled" => true,
|
||||
"android_graphql_skip_api_media_color_palette" => true,
|
||||
"creator_subscriptions_tweet_preview_api_enabled" => true,
|
||||
"freedom_of_speech_not_reach_fetch_enabled" => true,
|
||||
"tweetypie_unmention_optimization_enabled" => true,
|
||||
"longform_notetweets_consumption_enabled" => true,
|
||||
"subscriptions_verification_info_enabled" => true,
|
||||
"blue_business_profile_image_shape_enabled" => true,
|
||||
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled" => true,
|
||||
"immersive_video_status_linkable_timestamps" => true,
|
||||
"super_follow_exclusive_tweet_notifications_enabled" => true,
|
||||
],
|
||||
];
|
||||
|
||||
// Effectuer la requête POST avec OAuth et les en-têtes personnalisés
|
||||
$res = $client->post('friendships/create.json?screen_name='.$follow.'&follow=true', [
|
||||
$res = $client->get('NAHO_rBo3Yf1hBXROp7Msg/ConversationTimelineV2', [
|
||||
'headers' => $this->twitterHeaders, // Ajouter les en-têtes ici
|
||||
'auth' => 'oauth' // Assurez-vous que l'authentification OAuth est incluse
|
||||
'auth' => 'oauth',
|
||||
'json' => $params
|
||||
]);
|
||||
|
||||
// Décoder le JSON en tableau PHP
|
||||
$data = json_decode($res->getBody()->getContents(), true);
|
||||
|
||||
// Initialiser un tableau pour stocker les IDs
|
||||
$userMentionIds = [];
|
||||
|
||||
// Extraire les IDs des mentions uniquement pour la première instruction et la première entrée
|
||||
if (isset($data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['entities']['user_mentions'])) {
|
||||
$userMentionIds[] = $data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['user_id_str'];
|
||||
$mentions = $data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['entities']['user_mentions'];
|
||||
foreach ($mentions as $mention) {
|
||||
$userMentionIds[] = $mention['id_str'];
|
||||
}
|
||||
}
|
||||
|
||||
$userMentionIds = array_unique($userMentionIds);
|
||||
|
||||
foreach ($userMentionIds as $mention) {
|
||||
$stack = $this->Oauth1($user);
|
||||
|
||||
$client = new Client([
|
||||
'base_uri' => 'https://api.twitter.com/1.1/',
|
||||
'handler' => $stack,
|
||||
'proxy' => [
|
||||
'http' => 'http://xtjnmwvl-'.$user->id.':lp7iv1lq9glu@p.webshare.io:80',
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
// Effectuer la requête POST avec OAuth et les en-têtes personnalisés
|
||||
$res = $client->post('friendships/create.json?user_id='.$mention.'&ext=mediaRestrictions,altText,mediaStats,mediaColor,info360,highlightedLabel,unmentionInfo,editControl,previousCounts,limitedActionResults,superFollowMetadata&send_error_codes=true&handles_challenges=1', [
|
||||
'headers' => $this->twitterHeaders, // Ajouter les en-têtes ici
|
||||
'auth' => 'oauth' // Assurez-vous que l'authentification OAuth est incluse
|
||||
]);
|
||||
sleep(15);
|
||||
}
|
||||
}
|
||||
|
||||
public function like($user, $tweetid)
|
||||
@@ -259,7 +328,7 @@ class APIController extends Controller
|
||||
$unred = json_decode($res->getBody()->getContents(), true);
|
||||
|
||||
// L'URL des deux liens
|
||||
$url = 'https://myx.ovh/nova/resources/accounts/'.$user->id;
|
||||
$url = 'https://myx.ovh/accounts/'.$user->id;
|
||||
|
||||
$keyboard = [
|
||||
'inline_keyboard' => [
|
||||
@@ -579,6 +648,7 @@ class APIController extends Controller
|
||||
'text' => $text,
|
||||
]);
|
||||
}
|
||||
$stack = $this->Oauth1($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user