Note that there are some explanatory texts on larger screens.

plurals
  1. POgmail unread email count using curl
    primarykey
    data
    text
    <p>I created a script that can get the unread email list as a feed from the gmail here is my code</p> <pre><code>&lt;?php //function to get unread emails taking username and password as parameters function check_email($username, $password) { //url to connect to $url = "https://mail.google.com/mail/feed/atom"; // sendRequest $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_ENCODING, ""); $curlData = curl_exec($curl); curl_close($curl); //returning retrieved feed return $curlData; } //making page to behave like xml document to show feeds header('Content-Type:text/xml; charset=UTF-8'); //calling function $feed = check_email("username", "password"); echo $feed; ?&gt; </code></pre> <p>the output getting like this</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;feed version="0.3" xmlns="http://purl.org/atom/ns#"&gt; &lt;title&gt;Gmail - Inbox for suneth2@gmail.com&lt;/title&gt; &lt;tagline&gt;New messages in your Gmail Inbox&lt;/tagline&gt; &lt;fullcount&gt;1282&lt;/fullcount&gt; &lt;link rel="alternate" href="http://mail.google.com/mail" type="text/html" /&gt; &lt;modified&gt;2012-08-01T12:33:48Z&lt;/modified&gt; &lt;entry&gt; &lt;title&gt;eBCS Pro 1 August 2012&lt;/title&gt; &lt;summary&gt;bcs logo eBCS Pro 1 August 2012 Video interview Olympic IT The Met Police&amp;#39;s director of IT, Steve&lt;/summary&gt; &lt;link rel="alternate" href="http://mail.google.com/mail?account_id=test@gmail.com&amp;amp;message_id=138e21a3404cc7b2&amp;amp;view=conv&amp;amp;extsrc=atom" type="text/html" /&gt; &lt;modified&gt;2012-08-01T12:12:44Z&lt;/modified&gt; &lt;issued&gt;2012-08-01T12:12:44Z&lt;/issued&gt; &lt;id&gt;tag:gmail.google.com,2004:1409100718455703474&lt;/id&gt; &lt;author&gt; &lt;name&gt;eBCS Newsletter&lt;/name&gt; &lt;email&gt;e-bulletin@lists.bcs.org.uk&lt;/email&gt; &lt;/author&gt; &lt;/entry&gt; &lt;entry&gt; </code></pre> <p>so want to read the</p> <pre><code>&lt;fullcount&gt;1282&lt;/fullcount&gt; </code></pre> <p>tag </p> <p>when you pass the username and password to this function it can show the email list, I need to get only the message count, is there any way to catch or count the items</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload