Cannot get Facebook Profile Picture Size - facebook-graph-api

I am trying to get the size of Facebook user's profile pictures by using the following code:
getimagesize('http://graph.facebook.com/XXXXXXXXXXXX/picture?type=large')
where XXXXXXXXXXXXXX is the Facebook's user ID.
When I tested the code on my local machine, I could get the image size back. However, when I tested on remote server with www.domain.com, the (http://graph.facebook.com/XXXXXXXXXXXX/picture?type=large) return nothing.
What's possible reason of this issue? Can anybody give me some hints?
Thanks.

The getimagesize() requires that allow_url_fopen is set to "1" in php.ini. You may want to check that setting on your remote server.

Related

My Flutter frontend on FlutLab does not see my Django backend on Repl.it

I am trying (unsuccessfully) to get data from my django backend, developed on repl.it, to my flutter frontend, developed on FlutLab. On Flutter side, I get data successfully from, for example, https://jsonplaceholder.typicode.com/users. On Django side, I render my data normally and get data by Postman, also without problem.
But if my frontend send get() request directly to backend, I see just my circular indicator.
My URL on Flutter/Dio looks like
Response response = await Dio().get("https://djangobackend.myaccountname.repl.co/");
My ALLOWED_HOSTS on Django looks like
ALLOWED_HOSTS = ['djangobackend.myaccountname.repl.co', '0.0.0.0:3000', 'localhost', '127.0.0.1']
My browser is Chrome. My backend and frontend run on the same device (PC).
Actually I have no idea which host I need to use in this case, so, I just added all I could think of.
Is it possible to get data from my backend to frontend in this case and how to do it if yes?
If I need another IDE, please let me know. The limitation is: I can use online IDE only.
I also can provide more details if necessary.
All ideas are highly appreciated!
UPD: This is because of CORS policy, as you can see on attached screenshot.
Your problem is probably related to CORS policy. To check it, please, open Dev Tools => Console on your browser. Probably you need to add 'api.flutlab.io' and 'flutlab.io' to the "Access-Control-Allow-Origin" header on the server-side. If you need some more help, please attach screen or text of errors from the console mentioned above.

Microsoft Cognitive-Speaker Recognition - Verification profile - Create Enrollment

I am trying to make a call in Postman for the Microsoft Cognitive Service - Create Enrollment for Verification profile.
This is what I am using: https://westus.dev.cognitive.microsoft.com/docs/services/563309b6778daf02acc0a508/operations/5645c3271984551c84ec6797
I have an API URL created: https://internspeaker.cognitiveservices.azure.com/spid/v1.0 And the Subscription-Key.
I started by using their testing console and all of them worked perfectly until the enrollment process where I have to add an audio file in a specific format (.WAV with different characteristics). The Microsoft console asked me for binary data for the audio file and I could not get the audio file converted. So I found another way of testing by using Postman.
I took all other processes and they worked perfectly until I tried Create Enrollment for the Verification Profile. Here I added all the details + the audio file but I could not pass the error(the error is shown in the next link)
This is the error I am getting:
This is how I added the audio file in Postman:
This is a successful call with the same URL and subscription-Key:
Does anyone know how to deal with this problem?
Thank you very much
Your url is not in right format.
Your url should be https://internspeaker.cognitiveservices.azure.com/spid/v1.0/identificationProfiles/{your identificationProfileId}/enroll. You could find the success url format is correct.
And your way to add audio is fine.
Update:
if want to use verification profile to create enrollment, the url should be:https://internspeaker.cognitiveservices.azure.com/spid/v1.0/verificationProfiles/{your verificationProfileId}/enroll.

Cannot Access Url issue with Seeding database

I'm currently using the GCP vision API to automate writing a seed file to a db and I am running into an error that hasn't shown up before.
Error Message:
"image-annotator::error(12): We can not access the URL currently. Please download the image and pass it in."
I know about sending in base_64 images but my site is using remote images and downloading, converting, and then storing each image isn't feasible in this scenario. I've also checked that the URL being sent in is a valid photo and that it was a JPEG.
The IMAGE_PROPERTIES request has worked when making promised calls on a small scale and now it is returning this error on the first call, if anyone knows something about this I'd appreciate it greatly!

How do I get Alexa Voice Service registration code?

How do I get a registration code or otherwise solve this problem?
While writing this question, I realized the crux of this problem is the bottom-most part of this question: I'm not getting the popup I'm supposed to get and when I enter the URL in a browser it says invalid registration code.
I'm attempting to develop an Alexa Voice Service application. Website/companion service only. I have gone through the Reference Implementation Guide twice and have double checked that all of the setup has been done correctly.
This is the server error I get: invalid registration code. I never did anything with a registration code and can't seem to find anything about a registration code (relevant to Alexa) anywhere after googling quite a bit.
Listening on port 3000
error: { [InvalidRegistrationCode: The provided registration code was invalid.]
name: 'InvalidRegistrationCode',
message: 'The provided registration code was invalid.',
status: 401 }
Error: Can't set headers after they are sent.
Here's the client output:
vlcj: (DefaultMediaPlayer.java:183)
addMediaPlayerEventListener(listener=com.amazon.alexa.avs.AVSAudioPlayer$1#4b3a4950)
There was a problem connecting to the Companion Service. Trying again in 2 seconds. Please make sure it is up and running.
[DEBUG] joining on thread Thread[Timer-0,5,com.amazon.alexa.avs.AVSApp]
There was a problem connecting to the Companion Service.
Trying again in 2 seconds. Please make sure it is up and running.
The AVS launcher opens too, and when I record something and send it I get:
com.amazon.alexa.avs.AVSException: 403 Invalid Access Token
The instructions mention (at the very bottom of the reference guide) that I need to:
Please register your device by visiting the following website on any system and following the instructions: https://localhost:3000/provision/************** That URL is supposed to pop something up once the companion service but that hasn't happened.
Any thoughts on how can I fix this?
I was following a good document Project: Raspberry Pi + Alexa Voice Service at https://github.com/amzn/alexa-avs-raspberry-pi . It describes all steps very well.
Please take a look at the following steps:
3 - Getting started with Alexa Voice Service
3.1 Register for a free Amazon Developer Account
3.4 Register your product and create a security profile.
6 - Enable Security Profile
This thread on the Amazon developer forums seems related: http://forums.developer.amazon.com/forums/thread.jspa?threadID=11327&tstart=0
Quoted response:
There are a number of potential issues causing that error.
You might be sending an invalid scope. Are you sending "alexa:all" as
the scope? Or, your security profile might not be correctly linked. Is
it selected in the dropdown on the developer portal?
Are you getting an access token from the companion service, or is the
text box blank? If you're not getting an access token, check that your
device serial number matches between the companion service and the
java client. If you're getting an access token, the problem is more
likely with your security profile.
You should also look at these threads to see if they're helpful...
(links removed due to reputation requirement)
If that doesn't help, you'll probably have more luck asking the AVS team directly on their forum site.

Facebook Connect not setting cookies

I'm trying to implement Facebook Connect on a website with .NET MVC using C#.
I've followed the instructions here: http://wiki.developers.facebook.com/index.php/Trying_Out_Facebook_Connect step by step. I can make the login work as in that when I log in through the site I'm also logged into Facebook.
In order to work with this in the server I think I need to access the cookies Facebook is supposed to leave like:
APIKEY_user
APIKEY_session_key
...
as mentioned here http://wiki.developers.facebook.com/index.php/Verifying_The_Signature.
The thing is I'm not getting any of these cookies. I've googled and it seems like I'm the only person with this problem. Any ideas as to what I could be doing wrong ? Has this happened to anyone else ?
The issue was that I was developing locally using localhost.
I resolved the problem by changing the settings for the application to point to a certain web address instead of localhost and changing my hosts file lo point that same web address to 127.0.0.1
from the UI/client-side perspective, always insure you have the correct path indicated for the xd_receiver file in your FB.init() method.
Firecookie is very useful for seeing what Cookies are/aren't being set.