Page 1 of 1
Facebook Monitoring
Posted: Tue Mar 12, 2013 4:17 pm
by dige
hi folks, I'd like to download the following web page and automatically evaluate
https://graph.facebook.com/cocacola
The result is something like this:
Code: Select all
{
..
"talking_about_count": 938145,
"username": "coca-cola",
"website": "http://www.coca-cola.com",
"likes": 60926774,
..
}
There some difficulties: https and proxy-support.
Has anyone ever experience with the Facebook API?
Re: Facebook Monitoring
Posted: Tue Mar 12, 2013 5:06 pm
by dige
As a first shot, I did it with libcurl:
Code: Select all
;================================================================
; Project LibCurl
; Title Sample_1
; Author Progi1984
; Date 19/01/2008
; Notes Sends a request to a HTTPS server
;================================================================
XIncludeFile "LibCurl_Res.pb"
XIncludeFile "LibCurl_Inc.pb"
curl = curl_easy_init()
fp = CreateFile(#PB_Any, "Samples\Sample_1_SourceForge.htm")
If curl
Debug curl_easy_setopt(curl, #CURLOPT_PROXY, @"192.168.1.1")
Debug curl_easy_setopt(curl, #CURLPROXY_HTTP, 0)
Debug curl_easy_setopt(curl, #CURLOPT_PROXYPORT, 8080)
Debug curl_easy_setopt(curl, #CURLOPT_URL, @"https://graph.facebook.com/cocacola")
Debug curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYPEER, 0)
Debug curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYHOST, 0)
Debug curl_easy_setopt(curl, #CURLOPT_HEADER, 0)
Debug curl_easy_setopt(curl, #CURLOPT_WRITEFUNCTION, @RW_LibCurl_WriteFunction())
res = curl_easy_perform(curl)
Debug res
WriteString(fp, RW_LibCurl_GetData(), 0)
CloseFile(fp)
;always cleanup
Debug curl_easy_cleanup(curl)
EndIf