Upload an Audio File using Graph api - php

How to upload an audio file in facebook using graph api in php? use
feed or anything i can't figure out how to upload?

As far as I know this is not possible. You can only upload photos and videos. But you could host your audio objects on your site and share them via the Opengraph Audio ComplexType. See the reference here: https://developers.facebook.com/docs/opengraph/creating-custom-stories#propertytypes

Related

"Undefined index: media" when I want upload a media with Twitter API

I use TwitterOauth, a Abraham Williams library for Twitter API.
I want upload a media to insert into Direct Message.
I've an error when I try to upload base64 encode PNG image, with chunked, or not.
$upload = $connection->upload('media/upload', [
'media_data' => $base64Encoded,
'media_type' => 'image/png',
], true); // chunked
dd($upload);
Some people talk about passing media_data to media and giving the path to the file, but the Twitter API allows to give base64 encoded media, so I'm trying to make it work because I don't want to transfer the media to the server before uploading it to Twitter, even temporarily, because I don't have write access to the server.
So I generate a base64 image, and I just want to upload it to Twitter via the API and TwitterOauth SDK.
The image is generated with PHP, I encode it in base64. I want to upload directly to the Twitter API without saving the image. Twitter API allows this with the media_data parameter, but I can't figure out how to use it.
Here, the error I have when I execute the script.
How I can upload media from Twitter API?
According to https://github.com/abraham/twitteroauth/issues/681, that problem is worked on since some years, but without any progress. If the library does not support reading from a raw string yet, you should either write your raw string to a file (because reading data from a file to upload that data is supported), or you could work on that ticket to get it done within the library.
That's the beauty of open source: if a library does not support your needs, you can extend it and make others happy that might have the same problem :)

Who will be the owner of video uploaded through youtube direct?

I am working on a project where user can upload videos on my YouTube channel. I am using YouTube Direct Lite to create upload widget.
I wanted to know who will be the owner of those videos on YouTube?
According to YouTube DirectLite documentation :
The submission widget allows anyone visting your site to upload a new video to their own YouTube account from their hard drive, record a new video using their computer's webcam, or to submit a video that they've already uploaded for review.

saving facebook image on S3

I have seen many posts through which we can upload image on S3, but what if we want to save image from google/facebook , that is something like graph.facebook.com/abc.img (suppose it is a valid image)
I have seen a similar post but that uses Node.js but I simply want to use php to save image on s3,
any help in this matter is appreciated Thanks
You could use this Facebook SDK PHP Class:
https://developers.facebook.com/docs/reference/php/4.0.0
And this one for S3:
https://github.com/tpyo/amazon-s3-php-class
Get the image from Facebook with the Graph API.
Upload it to S3 with the Amazon S3 PHP Class
Should be pretty easy ;)

Custom audio player of facebook like soundcloud.com

When I share soundcloud.com audio mp3 in facebook it display audio player of soundcloud in facebook. we can play mp3 directly from facebook, suppose youtube: when we share youtube video link, it directly play video in facebook
I want to know how can i configure audio player like this?
I have tried to find lots of facebook graph documentation but nothing is useful for my issue.
please help me regarding this.
AFAIK, you can't do this. It's a different story with video, but I have never seen a playable audio in FB.

Is there a way to upload videos to youtube from our Website?

I am developing a website, where I am allowing users to upload videos, but if the members numbers keep on increasing and they keep on uploading more videos it will be expensive for me. So I want to upload the movies to youtube instead, is this possible?
By viewing some other posts here, I am thinking it is possible?
You need Youtube API to upload the videos with PHP.
There are some ready scripts you can use to upload to youtube, the one that deserves mention here is:
PHPTube
More Resources
Use the YouTube API with PHP
YouTube Uploader
In addition to Sarfraz's links you also have the Services_YouTube PEAR package and the Zend_Gdata_YouTube class. They are both very well documented.

Categories