I am trying to integrate Disqus comments to my Android application, and I am following this tutorial:
http://globeotter.com/blog/disqus-android-code/
I didn't understand well part about disqus_identifier. As you can see from the code below I use this code to acces showcomments.php on my server.
webDisqus.loadUrl("http://balkanandroid.com/showcomments.php?disqus_id="+identifer);
Where identifer is part of url behind top level domain name, something like this:
http://balkanandroid.com/graficka-evolucija-nexus-telefona/
And I use /graficka-evolucija-nexus-telefona/ as disqus identifer.
And I get this error message:
We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Here is server side php code>
Based on the example code provided, this is a pretty easy fix. Just change this line:
var disqus_shortname = '<balkanandroid>';
to this:
var disqus_shortname = 'balkanandroid';
Related
When I am using any code related with php + AngularJS then its not able to share anything on pinterest direct from our application.
Like:
$pinterest = new PinterestAPI('487992287213444318092', '3e49484c42b9a43716b6306c43083aaed2860a879d5f6ef112c01e1');
$loginurl = $pinterest->auth->getLoginUrl('http://localhost:3000', array('read_public, write_public, read_relationships,write_relationships'), 'code');
Any code structure like:
https://github.com/sahat/satellizer/blob/master/examples/server/php/app/Http/Controllers/AuthController.php
this code structure working fine with others sharing.
Please note that you are only able to share public available URLs. You are not able to share local URLs. You need to know that the pinteres API is crawling your ShareUrl. This is not possible on your local environment because the web crawler could not access it.
The PDF.pin syntax is the following. It does work with public web URLs.
PDK.pin( ImageUrl, Description, ShareUrl, function(){
// Do whatever you like
});
Using PHP I need to get a list of company webex meetings and show them on web page
I tried the code on this page: https://developer.cisco.com/site/webex-developer/develop-test/xml-api/sample-code/
But that failed.
<serv:header>
<serv:response>
<serv:result>FAILURE</serv:result>
<serv:reason>Failed to get SiteUrl</serv:reason>
<serv:gsbStatus>PRIMARY</serv:gsbStatus>
<serv:exceptionID>010000</serv:exceptionID>
</serv:response>
</serv:header>
<serv:body>
Error message was that it could not find the SiteURL. The siteurl I was using is companyname.webex.com - when I put that url into browser, it goes to our webex page, so it seems to be correct.
I found this: http://joshuamcginnis.com/webex/ and tried it (using real credentials), but it gives a 500 error and I have no access to logs.
Both of these examples are very old and I am struggling to find up-to-date examples.
If I put https://company.webex.com/WBXService/XMLService into browser, I get a success message
Can anyone suggest how to do this in either PHP or javascript
According to the PHP example in the link, you must be using something like:
<securityContext>
<webExID>YourCiscoUsername#example.com</webExID>
<password>YourCiscoPassword</password>
<siteID>243585</siteID>
<partnerID>g0webx!</partnerID>
</securityContext>
Try using the "siteName" instead of "siteID", like the following:
<securityContext>
<webExID>YourCiscoUsername#example.com</webExID>
<password>YourCiscoPassword</password>
<siteName>go</siteName>
<partnerID>g0webx!</partnerID>
</securityContext>
You can use siteID or siteName indistinctly, but looks like that siteID isn't working for that demo site right now. Their Java and .Net examples are using siteName.
Now, you have to use "go" in siteName if you are making the request to https://go.webex.com/WBXService/XMLService
But you must use "apidemoeu" if you are making the request to
https://apidemoeu.webex.com/WBXService/XMLService
They both appear to be demo sites.
And effectively "Failed to get SiteUrl" is the error returned if the value passed in either siteName or siteID doesn't correspond to an existing site.
I have a working PHP app that connects to Quickbooks online, loosely based on code from Pearce (thank you!). I'm using the Intuit PHPv3 SDK (version 2.0.4).
My setup code looks like:
<script type='text/javascript' src='https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js'></script>
<ipp:connectToIntuit></ipp:connectToIntuit>
and then, in Javascript:
intuit.ipp.anywhere.setup({
grantUrl: 'http://mywebsite.com/qbo/oauth'
});
This works fine, but I would like to add a Blue Dot Menu, which I assume gives the ability to disconnect the session and do other things. To do this, I know that the Javascript should really be saying:
intuit.ipp.anywhere.setup({
grantUrl: 'http://mywebsite.com/qbo/oauth',
menuProxy: 'http://mywebsite.com/qbo/blue-dot-menu
});
Trouble is, I have no idea what to put in the implementation code for the blue-dot-menu handler, and I've now spent quite a long time trying to figure this out from Intuit's documentation without success.
Any ideas appreciated!
The implementation of the Blue Dot menu is actually pretty simple -
Make a HTTP GET request to:
https://appcenter.intuit.com/api/v1/account/appmenu
That's OAuth authenticated. Print out the contents of what you get back to the page. Boom, done.
If you want an actual working example, use the open-source DevKit on GitHub - examples are here:
https://github.com/consolibyte/quickbooks-php
Specifically these examples:
https://github.com/consolibyte/quickbooks-php/tree/master/docs/partner_platform/example_app_ipp_v3
Which have a working example of the Blue Dot menu all ready to go for you, wrapped up in a nice OOP wrapper:
https://github.com/consolibyte/quickbooks-php/blob/master/docs/partner_platform/example_app_ipp_v3/menu.php
It's this simple:
<?php
require_once dirname(__FILE__) . '/config.php';
// Display the menu
die($IntuitAnywhere->widgetMenu($the_username, $the_tenant));
You can have a look at the following JAVA implementation.
https://github.com/IntuitDeveloperRelations/IPP_Sample_Code/blob/master/QuickbooksAPI/Java/Spring%20Application/QuickBooksAPI/src/main/java/com/intuit/controller/support/BluedotController.java
You need to make the following call in the PHP way(using the OAuth and Http libs).
final IAPlatformClient pClient = new IAPlatformClient();
final StringBuffer stringBuffer = new StringBuffer();
final List<String> menuList = pClient.getAppMenu(WebUtils.OAUTH_CONSUMER_KEY, WebUtils.OAUTH_CONSUMER_SECRET, accesstoken, accessstokensecret);
Other things are quite straight forward.
Hope it will be helpful.
Thanks
Background:
I am making a facebook app where users post messages like in a forum. For that I save the users facebook id to then present their names. I know it is possible to show the name out of a facebook id by using the Graph API, but I can't make it work.
The code I use is the following:
//$fbId is the facebook id to find out the name for
$facebookUrl = "https://graph.facebook.com/".$fbId;
echo(file_get_contents($facebookUrl));
$str = file_get_contents($facebookUrl);
$result = json_decode($str);
echo($result);
return $result->name;
I researched and tested this for hours, but I feel like I'm getting nowhere. I got an idea of how it works from:
http://www.phpexpertsforum.com/how-to-get-the-facebook-name-with-user-id-using-php-code-t1852.html
Didn't work so I researched further from here:
Get user's name from Facebook Graph API
I dowloaded and currently use the Facebook php SDK, but I don't find the way to use it to get anyone's name other than the current user.
The problem here seems to be the file_get_contents() function that returns a false, meaning that it can't read the file.
I checked out the php documentation. Also, by using the php functions fopen() and file().
//echo(pathinfo($facebookUrl, PATHINFO_EXTENSION)); -> Doesn't give any response!
//echo(file_exists($facebookUrl)); -> No response!
//fopen() doesn't work
//file() doesn't work
//file_get_contents() doesn't work
//tried adding an access token to the $facebookUrl but it doesn't make any difference
Any idea of what could be wrong here? Little guidance would be very helpful. What am I doing wrong? What did I miss?
Seems that your allow_url_fopen directive is set to Off.
Look for it in your php.ini (or create a php file containing <?php phpinfo(); ?> and point to it in your browser) and check if is set to 'On'.
I want to connect to public facebook page or group and list all entries from the wall on a personal website. I will use PHP on my server so that would be the best solution for me. Or javascript.
Could anyone explain or perhaps give a working code on how to do this? Or just all steps nessesary for making this?
If its possible to handle information about person, date, description ... for each post, that would be great! So my layout could be customized.
Thanks for helping me out here!
You need to run FQL on stream table and provide id of a page or group you are interested in as source_id (fb docs have some explanation and examples). Once you get stream data you can dig deeper and get user who left this post or any other data you need again through FQL.
There are many ways of running FQL - it could be done in JS API, PHP API, or through old REST API.
use the facebook graph api urls that they provide
python code using simplejson parser
keyword="old spice"
searchurl='http://graph.facebook.com/search?q='+keyword
resp=urllib2.urlopen(searchurl)
pageData=resp.read()
json = simplejson.loads(pageData)
posts=json['data']
for p in posts:
postid=p['id']
username=p['from']['name']
posterimg=p['icon']
comment=p['message']
In JavaScript (jQuery).
You can use my spare access_token for viewing public groups or pages ;)
To get your own access token the facebook graph explorer can generate one for you (as well as test queries).
In Javascript we make a request to facebook graph, which returns a JSON object. The response looks like this.
The code below iterates though each entry and prints out the message, if you look at the link above it gives you the naming convention for the other data fields.
for example:
data.data[0].created_time;
data.data[0].from.name;
etc..
Hope that Helps!
<!DOCTYPE html>
<head>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
</head>
<body>
<ul id = 'list'>
<script>
var graphQuery = 'https://graph.facebook.com/2228101777/feed';
var authToken = '145634995501895|477bb3c939123a5845afe90d.1-100002565213903|F1VA26jsYL7yBeq2iU6SZX_XXrs'
var url = graphQuery +'?access_token='+ authToken +'&callback=?';
$.getJSON(url,function(data){
for( i=0; i < data.data.length; i++){
$("#list").append('<li>'+ data.data[i].message +'</li>');
// add some more here if needed
}
});
</script>
</ul>
</body>
</html>
What you are talking about, as far as I can tell, is Web Scraping. What you would do is get the URL of the group, use the file_get_contents($url) command in PHP to get the file, and then analyze it in PHP.
I'd suggest brushing up on your regular expressions for this, as it'll be important to review the HTML that Facebook uses for the wall posts. You'll be able to get the information that you're looking for from the HTML.
I would post some example code, but that's on another computer, far far away. Still, should be a good start.
Edit: Adding in some example code:
$URL = "http://facebook.com/group=5343242" (or whatever the URL structure is for the facebook group)
$groupPage = file_get_contents($URL)
Here's the link to the PHP pages on Regular Expressions:
http://www.php.net/manual/en/book.pcre.php