Submit Sitemap With PHP
I have been tyring to get this api working for literally hours. I can't even get the try this api part working with api key. I tried to use it with cURL like this:
$submitSite = curl_init($submit_url); curl_setopt_array($submitSite, [CURLOPT_PUT => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Accept: application/json"]]); $responseContent = curl_exec($submitSite);
But it returns 0. I url encoded siteUrl and feedpath parts and added the api key at the end. How can I submit my website's sitemap automatically?
You're missing the authorization part. You must have the proper permissions to https://www.googleapis.com/auth/webmasters to add the sitemap.
In your code I don't see any headers for this authorization. For more info check: https://developers.google.com/webmaster-tools/search-console-api-original/v3/how-tos/authorizing
See also questions close to this topic
Awarding prizes to pilots for each flight date in Laravel
I have tree model :
Pilot , Flight , Prize
Flight model contains :
pilot_id , flight_id , flight_date, prize_check=(defalt = 0)
Prize model contains :
pilot_id, flight_id, flight_date, prize_count
I want to give pilots a prize once a day. Even if they fly twice on the repetitive date, they will be awarded a prize.
I want to check Flight model daily by Task Scheduling and save Prize model . and Update prize_check==1 after check completed
----------------------------------------------------------------------------- pilot_id ---- flight_id ---- flight_date ---- prize_count 1 ---- 2 ---- 2020-04-01 ---- 1 1 ---- 3 ---- 2020-04-01 ---- 0 1 ---- 4 ---- 2020-04-02 ---- 1 1 ---- 5 ---- 2020-04-02 ---- 0 1 ---- 6 ---- 2020-04-03 ---- 1 1 ---- 7 ---- 2020-04-03 ---- 0 1 ---- 8 ---- 2020-04-03 ---- 0 ----------------------------------------------------------------------------
How can I write this?
Can php have multiple doctypes?
<!--<!DOCTYPE html>--!> <html> <head> <title>Setting up database</title> </head> <body> <h3>Setting up...</h3> <?php // Example 27-3: setup.php require_once 'functions.php'; createTable('members', 'user VARCHAR(16), pass VARCHAR(16), INDEX(user(6))'); createTable('messages', 'id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, auth VARCHAR(16), recip VARCHAR(16), pm CHAR(1), time INT UNSIGNED, message VARCHAR(4096), INDEX(auth(6)), INDEX(recip(6))'); createTable('friends', 'user VARCHAR(16), friend VARCHAR(16), INDEX(user(6)), INDEX(friend(6))'); createTable('profiles', 'user VARCHAR(16), text VARCHAR(4096), INDEX(user(6))'); ?> <br>...done. </body> </html>
How to print 2D arrays in a table with key name(just one time) and all it's values php?
Array ( [1JANATAMF] = Array (  = 4.10  = 5.10  = 6.10  = 7.10  = 8.10  = 5  = 0.02  = 5413 ) [1STPRIMFMF] = Array (  = 12.90  = 1.90  = 16.90  = 11.90  = 14.90  = 24  = 04  = 10 )
I have this kind of arrays. Now I want to print then in a table with the key name of the main arrays (once) on the table row with its all values. Table I Want is like:
1JANATAMF 4.10 5.10 6.10 7.10 8.10 5 0.02 5413 1STPRIMFMF 12.90 1.90 16.90 11.90 14.90 24 04 10
My Code is this which prints all keys together and some values at the end.
foreach ($c as $keys =>$values) echo $keys . " ";`enter code here` foreach ($values as $key=>$data) echo " " . $data . "<br>";
Google search Console API return 404
I would like to simply fetch some data from Google Search Console via API. I am struggling with Oauth2 for days but to be hones I don't really know what is it, and how it should be used. I don't really mind about security, it is not a super secret project, so I am trying to get some data with a simple API key, but it doesn't work neither. I have an API key what I generated in Google Cloud Console I am trying to get data with Postman based on this example, but I always get 404 error.
**Can you help me what do I wrong? It shouldn't be so complicated. **
Tela de consentimento OAuth via Cloud Shell
Olá essa é minha primeira postagem então já peço desculpa se estou errando em alguma coisa rsrs.
Estou criando alguns projeto no Google Cloud porem e muito cansativo criar manualmente, então conheci a ferramenta do Google Cloud chamada Cloud Shell a mesma da pra fazer tudo por linha de comando e para meu caso seria ótimo ! consegui fazer boa parte do que preciso, porem não estou conseguindo fazer a criação das duas etapas a seguir:
Já procurei em todos os documento do google que eu conheço e não encontrei como fazer a criação dessas duas etapas Cloud Shell.
Alguém já fez esse procedimento ou saber alguma documentação do google que eu possa estuda para conseguir fazer ?
Get youtube-channel videos from specific range using goole api , or any other method
I tried get youtube videos from play list using google api. It succeeded. But i can get 50 maximum videos. What i need to do is , get more than 50 or get oldest videos from range.
Like we can limit result in mysql.
Languages ( PHP & Java Scripts )
My worked code
I read google api documentation and not get clear answer. Please don't close question. i need clear answer.
Google Search Console deadlock: Unable to remove URL so I can index a different URL
I recently tried some SEO tweaks to see if I could improve traffic to my personal website. One of these changes was shortening some of my URLs. This worked just fine for about 4-5 of the URLs that I changed, except for one.
The problematic URL is
Which I shortened to
The former URL no longer exists on my website, and I did not set up a 301 redirect. Instead, I requested that Google remove it from search results via Google Search Console. I also requested that it index the new URL.
Basically, I'm in a bizarre deadlock situation where Google refuses to index my new URL, claiming it selected the old one as a canonical because of "duplicate content":
According to the Removals page, the old URL was in fact removed:
But when I inspect this old URL, Google Search Console claims the URL is on Google:
How do I get out of this mess?
why my google search console shows 5000 clicks but google analytics shows only 700 to 800 users? Earliar in this case it shows atleast 4000 users
I am a new Wordpress blogger. About 1 month ago, my website get hits of 3500 to 4000 users/ day and Google search console shows almost 4500 to 5000 clicks. But nowadays google search console show 5000 clicks but google analytics shows only 700 to 800 users? Earlier in this case it shows at least 4000 users.