Post to page at any time (offline access) - facebook-php-sdk

I'm trying to make a app that integrates into the WHMCS that will allows admins to set posts that will be put on their FB page's wall at a certain time.
I am using a piece of code that allows me to post to the page ok but when trying to run the PHP script from a CLI (Shell):
root#golf [~]# php -q /home/host/public_html/modules/addons/social/cron.php
I receive the following message:
Please check Facebook API settings, OAuthException: (#803) Some of the
aliases you requested do not exist: 0
Could someone please tell me what this message means and how I can get this working.
Also if I have not access the app from the web interface for a while the following message is displayed:
Exception: 102: parameters uid or session key required
A popup then appears on that page and it refreshes, the message is no longer there (until I come back a little later)
Would be great for as much help as I can get.
Daniel Collins.

Related

Contact Form 7 - mail_failed

I have a Wordpress 4.9.20 running Abiko theme website.
I have a contact form 7, and when I submit it, it throws the following error:
{into: "#wpcf7-f15498-p7-o1"
message: "There was an error trying to send your message. Please try again later."
status: "mail_failed"}
Yesterday I had captcha 2 and it was throwing a spam error, now I updated to captcha 3 and it throws mail_failed. The website it not used frequently and I don't know when the error started.
Are there any backend logs I can check? Or I need to install a plugin for everything on WP? What should I do to debug this? I haven't worked with WP before.
A few things can cause this error. What color border is around the error "There was an error trying to send your message. Please try again later." Orange or red?
Red tells you that the form is not sending and is caused by your server not sending the email. Try contacting the host.
Orange tells you that your form is not sending because of a spam issue. First try removing the [recaptcha] shortcode and test again to see if the problem remains.
If it still has the issue then you have some sort of odd configuration going. Generally there are two different ways of fixing this issue: You can either create a business email address with your domain name and use the new email in your contact form settings, or you can install and set up an SMTP plugin and use a dedicated email sending service.

Can't reset user's password in Google Identity Toolkit: "CAPTCHA_CHECK_FAILED"

I'm trying to setup my Google Identity Toolkit so users can reset their passwords. I'm following the documentation here: https://developers.google.com/identity/toolkit/web/required-endpoints#send_email_url
I'm using the PHP Gitkit Client outlined here: https://github.com/google/identity-toolkit-php-client/blob/master/src/GitkitClient.php
Specifically the function getOobResults() on line 307 seems to be unhappy for some reason. Here's where I'm at:
User sets up account and logs in successfully
User then logs out and starts to log back in, enters email in and clicks "Forgot password"
reCaptcha is shown, click check box and then hit continue
At this point my 'Send Email URL' endpoint (gitkitEmail.php) is successfully called and the following POST is set to it (dropping the full '&response' param since it goes on for a while):
action=resetPassword&email=xodfebefa%40nada.ltd&challenge&response=03ACgFB9tGlNt2KAGhrVY....
I then take that string and parse it using parse_str(); since getOobResults() is looking for an array. However, response I get back is always:
{
"response_body": {
"error": "CAPTCHA_CHECK_FAILED"
}
}
I searched around but can't find any details on this error. Any help would be appreciated. I don't have a reCaptcha setup anywhere on my site, unsure if this is expecting me to do that and that's why it's failing? Also, I did bump all my code to a production environment and got the same error there as I did on my localhost.

send grid & parse 502 Bad Gateway with nginx

I am trying to migrate my parse application over to digital ocean and followed this guide :
https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04
Everything works perfectly fine until I get to the very end Test Parse Server ( Executing Example Cloud Code ) section
I tested the cloud code for the sample cloud code that was provided in the tutorial :
Parse.Cloud.define('hello', function(req, res) {
res.success('Hi');
});
so I got a Hi back in my browser as well as in postman.
See image here : https://cloudup.com/cH2dbBx1KTo

Then I test the function that uses sendgrid's service to send emails (http://blog.parse.com/announcements/introducing-the-sendgrid-cloud-module/), my cloud code file looks like this :
see image : https://cloudup.com/cD6MNRP3Tft
and now I try to run my post request from postman and I get an error even on my hello function that was working before
See image : https://cloudup.com/cIkwJ6552_5
So I look around and figure out that its an issue with my sendgrid import
var sendgrid = require("sendgrid");
sendgrid.initialize(“xxxxxx”, “xxxxx.”);
in these lines.
does anyone have any experience with digital ocean cloud code and send grid emailing service please help me out I will be grateful as this is the last step left and I will be done with my migration :)
cheers
Tanzeel
you have to specify server URL in parse config file. It is required and could be the reason why you cant run cloud code.
"PARSE_SERVER_URL": "http://localhost:1337/parse"
The url has be the same what you are using. There is also error in Nginx config in that tutorial, I explained it here https://serverfault.com/questions/765627/cannot-post-get-over-ssl/766428#766428
So I looked up at pm2 and to see real-time logs the command is
pm2 logs
at first when I ran the command I saw some errors, maybe they were there from before :
Then I tried the hello cloud function from postman app to test for its output in pm2 logs and I got the following :
Next I try to run my sendMail sendgrid function and I find out the the api-key I had used in my sendgrid function was throwing an error
ReferenceError: XXXXXXXXXXXX is not defined
So I went back to my cloud code and used quotes around my api-key parameter and passed it as a string in my send grid initialize function. Then I retry and get
[Error: The provided authorization grant is invalid, expired, or revoked]
So I went back to my sendgrid account and made sure that the api-key I was using was the correct one and it seemed to be just fine. I tested again and got the same error again so I decided to generate a new api-key just in case.
So I realize that I was not using the api-key but instead API KEY ID :
When we create a new api-key on sendgrid they give us the actual api key once and they ask us to store it in some secure place :
We can only display the key above one time. Please store it somewhere safe because as soon as you navigate away from this page, we will not be able to retrieve or restore this generated token.
So after I used an actual api-key I was able to send emails 😃
But one small issue still remains and I am not sure if its because of postman that I am using to run cloud code or something in the parse server or nginx that is still returning me with a 502 Bad Gateway as a response
But when I look at the logs for my parse server I do see a
parse-wrapper-0 { message: 'success' }
but it never gets back to me in my postman and instead I am getting a 502 error not sure why but the emails are being sent succesfully :)

Integrate twitter in drupal 7 website

I am trying to get the twitter module (7.x-5.4) running on my local drupal 7.19 website. Already installed Oauth and registered a twitter app. I am using the keys of that twitter app.
Callback URL
http://localhost/drupal-7.19/twitter/oauth
twitter host
http://twitter.com
Twitter API
https://api.twitter.com
Twitter search
http://search.twitter.com
TinyURL
http://tinyurl.com
when I want to add at least my own twitter account so that the site can display my tweets. when I want to add this account, an error occurs:
Notice: Undefined property: stdClass::$data in Twitter->request() (line 131 of root\modules\twitter\twitter.lib.php).
Could not obtain a valid token from the Twitter API. Please review the configuration.
any ideas? thanks in advance.
In my case, uncommenting the line
extension=php_openssl.dll
in php.ini resolved the error.
I'm not sure this will work for you, but this worked for me. I had the same exact error, even though I had followed the documentation. Here's the test: go to admin/reports/status. If you see the following warning: "HTTP request status Fails" this means your drupal/LAMP stack is unable to use DNS to callback to itself. In my case I used my machines's IP to access my Drupal instance. So, rather that use "localhost" use your machine's IP address (you can use ipconfig on MSWin or ifconfig on Mac/Linux) and use that for finishing the twitter account setup process.
Again, not
http://localhost/drupal-7.19/twitter/oauth
but
http://10.0.1.9/drupal-7.19/twitter/oauth
(substituting your machine's IP address)
I was getting the exact same error which i fixed by adding appropriate proxy server details.
Notice: Undefined property: stdClass::$data in Twitter->request() (line 131 of C:\wamp\www\test_twitter\sites\all\modules\twitter\twitter.lib.php
The problem was due to proxy-settings. I added values for $conf['proxy_server'] and $conf['proxy_port'] in settings.php and this error vanished.
I also verified that if i remove the proxy settings, this error is reproduced again.
Install oauth_common and twitter on your Drupal site
Check that both Oauth and the Twitter modules are enabled. I didn't use any of the other Twitter modules to do this
Go to the twitter module in Drupal
Go to the Configure (button) -> settings (Tab)
(note that the Callback URL is http://localhost/yourwebsite/twitter/oauth i.e. it doesn’t have to be 127.0.0.1)
Click on the link that says register your application
Go to twitter and sign in to be a developer
Add a new application, making a distinct feed name
Enter your site details
For localhost use: http://127.0.0.1:8000/twitter/oauth for both the website and callback URLs
Press save when you've done
Next go to the Test OAuth button - this will give you your illusive consumer key and consumer secret key
Back to the Drupal website and and to the twitter module to configure (button) -> settings (Tab)
Copy and paste these consumer and consumer secret keys you just got
Press Save configuration
Hopefully no errors.
Go to the twitter tab in the module and hopefully your twitter avatar has appeared
Read the top of the page where it says "Tweets are pulled from Twitter by running cron. You can view the full list of tweets at the Tweets view."
Select the View Tweets checkbox and click view - Chances are your tweets won’t show up in the next window - yet
Go to your drupal Configuration screen and to [System] Cron and press the "Run cron"
Now go back to view tweets from the twitter module and they should all appear
[This was a pig to figure out]

Connect with facebook - ASP.NET 3.5

I am trying to develop a “connect with facebook” with ASP.NET 3.5 and have followed lots of articles but I am not able to get it working. Most of the developers who spoke about this matter end up referring to the below article:
devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/
I followed that article, but the only thing I was able to get working was checking the authentication status of the current user:
devtacular.com/articles/bkonrad/how-to-integrate-with-facebook-connect/
However, trying to read users’ data gives me the following error all the time (although the same key was used in the previous successful test! - checking the authentication):
Invalid API key specified
The app you are trying to access does not exist or has been disabled.
The link to the 2 pages I developed are below, you may try them to see what I have done:
http://www.myifaworld.com/desktopModules/facebook/connect.aspx (the connect method - works fine)
http://www.myifaworld.com/desktopModules/facebook/bkonrad_1.aspx (reading users data - error)
I basically want users to click on the “connect with facebook” on my page to login using facebook and my code reads users’ info and save the users’ basic information to my database.
Any help is highly appreciated!
Checked your both pages
Your user data page gives below error.
FB.Event is undifined.
and also you dont have the refeence to the fb script above your code.
try adding these lines in your code above FB.Init
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
Read my blog for deail facebook connect integration
http://codethatworkedforme.blogspot.com/2011/08/facebook-connect.html

Resources