Posting image/video to MySpace using API? - c#

I am Working in Asp.net 3.5 with c# 2008.I have done authentication part & I'm also able to get all image URLs or videos from my application. I'm also able to send messages to MySpace. Now I would like to post images & videos.
Please let me know how can I post images/videos from my application.

Here is a link to the Documentation on using Media Items API.
http://wiki.developer.myspace.com/index.php?title=OpenSocial_0.9_MediaItems
It explains how to use it.
you need to Issue a POST request on following URL
http://api.myspace.com/1.0/mediaItems/{personId}/{selector}/#videos
if its image then set content-type to image/{type} like content-type="image/jpg" for jpg
these formats are supported: .jpg, .gif, .bmp, .tiff, .png.
similarly for videos use content type like content-type=”video/mpeg”
these formats are supported .avi,.mov,.mpg,.wmv.
For more details please consider checking out above link.
For details on what a POST request is or what is its structure check out this http://www.jmarshall.com/easy/http/

Related

Download attached file from Facebook using C# API

I able to download an image from facebook conversations using FB API but now i had a problem to download an attached file (.doc, .txt, .log and etc.) from facebook using graph FB API.
Json result return by Facebook if have attached file as below:
"message":"test sent attachment","attachments":{"data":[{"id":"10203275664207489","mime_type":"application/octet-stream","name":"service.log","size":432}]}},
Which is dont have any URL link to the file. But for image that json return by facebook contain url for the that picture. See Json below:
"message":"Gambaq","attachments":{"data":[{"id":"10203185045102068","mime_type":"image/jpeg","name":"10391434_10203185044782060_6466381862586755357_n.jpg","size":null,"image_data":{"width":720,"height":960,"is_sticker":false,"url":"https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpt1/v/t34.0-12/11304104_10203185045102068_881196838_n.jpg?
I use this API code for getting Json result:
dynamic resultsByApi = fb.Get("/" + fbFanPage + "/conversations?access_token=" + tokenPage + "");
My question here is anybody know how to get attached file URL for facebook conversations using FB API?
Can anybody please help me to solve this issues. Thank you in advanced.
To use the REST method to get the attachment data, it's
https://api.facebook.com/method/messaging.getattachment
With expected parameters are:
access_token=YOUR_ACCESS_TOKEN
mid=MESSAGE_ID
aid=ATTACHMENT_ID
format=json //(it defaults to XML otherwise)
{"content_type":"image\/png","filename":"jagadeesh.png ","file_size":14587,"data":<contents of data>}
its working v2.0 is expected..
also look at this fql details

Integration of Ogone payments with alias support

I have problems with Ogone Payment provider.
My task is to integrate this payment method, but with alias support, not with credit card number support.
I have searched several times for samples and solutions, also in the Ogone support documentation, but withoud success.
Example1Example2Example3
My question is: Is there a webservice or open web api for making request to Ogone? Did anyone have found samples for this provider writen in C#?
I have found answert of my question.
There are the steps for simple Ogone Payment.
Download Ogone Direct Link Guide from here.
Download Ogone Alias Manager Integration Guide from here.
Try to read them, because all of the info are inside of them.
Find the URL to make request to. Ex: https://secure.ogone.com/ncol/test/orderstandard.asp
Post data to the url like in this example.
The data should include several important components and must be similar to this:
"PSPID=username&
ALIASUSAGE=Test&
ORDERID=OrderId&
AMOUNT=Price*10&
CURRENCY=EUR&
ALIAS=GUID&
LANGUAGE=en_EN&
ACCEPTURL=SomeUrl&
EXCEPTIONURL=SomeUrl&
DECLINEURL=SomeUrl&
SHASIGN=SHA1EncriptedPhrase"
The SHASIGN is encripted passphrase that is taken from the OgoneBackoffice.
If response successd, then you should recieve an Html page.
Put the reponse into an IFRAME or where you want. This is the page for payment.
If there are some issues, please read the Direct Link Guide for them.
After successful payment the user will be redirected to the links in the request.
For More question, please comment.

Get all of the videos and activities from a Youtube user

I'm trying to get all of the videos uploaded by a Youtube user, the Uri I used is this one : https://gdata.youtube.com/feeds/api/users/userId/uploads, which I've got from this link.
The same goes with the user activities it seems I can't get all of the user activities using the Uri described in the same website.
So anyone has any idea how to get all of the user's uploads and activities?
There are 7 (in words: seven) samples of how to get the uploaded videos with the new awesome v3 Api here:
https://developers.google.com/youtube/v3/code_samples/
It should be easy to look at one and convert it into the language of your desire.
With this tool you can test all the variations of input to find out how to get all videos:
https://developers.google.com/youtube/v3/docs/playlistItems/list#try-it
(Spoiler: Default settings)
You can get the PlaylistID that contains all uploads by fetching the channel Informations:
https://developers.google.com/youtube/v3/docs/channels/list#try-it
I recommend that you take a look at the V3 API and good luck!

Get image using JSONP C#

I want to get an image by passing a url using JSONP, what is the best way to go about this, can I do this without a library. What library should I use? any tutorials? thanks
Use a Callback Specify a callback URL via the callback=http://??? GET parameter. The URL will be called via a JSONP request and the location of the image passed, the receiving end can then integrate the image into the app. (the callback parameter should be urlencoded)
for cross domain request I suggest this link:
http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
try to pass the image path, it might work or with jsonp I think the other site should have web method that transforms the image into bytes and return it. You can search about Ajax upload download image to see how things can work for image.

How to programatically upload/post an image to an image hosting website without a browser?

I want to write a simple utility to upload images to various free image hosting websites like TinyPic or Imageshack via a right-click context menu for the file.
How can I do this using .NET? I've seen some linux scripts that use cURL to post images to these website but I'm not sure how I could create the post request, complete with an image in C#?
Can someone point me in the right direction?
EDIT:
I've found a pretty good resource. Cropper, a free screenshot tool written in .net, has a lot of open-source plugins. One of them is a SendToTinyPic.. complete with source. Link here:
http://www.codeplex.com/cropperplugins
The FlickrNet API makes this extremely easy for working with Flickr from .NET. You have to have a Flickr account as well as an API key and shared secret. Once you have what you need, working with the API is very simple:
// http://www.flickr.com/services/api/misc.api_keys.html
string flickrApiKey = "<api key>";
string flickrApiSharedSecret = "<shared secret>";
string flickrAuthenticationToken = "<authentication token>";
Flickr flickr = new Flickr( flickrApiKey, flickrApiSharedSecret );
flickr.AuthToken = flickrAuthenticationToken;
foreach ( FileInfo image in new FileInfo[] {
new FileInfo( #"C:\image1.jpg" ),
new FileInfo( #"C:\image2.jpg" ) } )
{
string photoId = flickr.UploadPicture(
image.FullName, image.Name, image.Name, "tag1, tag2" );
}
Use HttpWebRequest.
Using this class, you can POST data to a remote HTTP address, just set the mime/type to multi-part/form encoded, and post the binary data from the image with the request.
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.71).aspx
For ImageShack, take a look to this Application.
TinyPic.com doesn't have an API as far as I know, but the Cropper SendToTinyPic Plugin tries to upload using "Screen scraping". The official version of the plugin doesn't work right now, but I put together a patch using the same approach, and submitted it to the cropperplugins project. It's just one source module that changed. Anyone can download the plugins project, and then drop in my patch and it should work.
With the patch, it's PritScrn or Alt-PrntScrn will save the image and upload to tinypic, and stuff the URL of the raw image on your clipboard. All in 2 seconds. easy.
If you don't want the actual tool, you can still look at the source code of my patch to see how to POST a page with form-data and a file upload. No direct link. See http://cropperplugins.codeplex.com/SourceControl/PatchList.aspx and look for #3239.
This example image was produced and then auto-uploaded to tinypic.com with the Alt-PrtScrn key-combo.
To embed it here, I just had to ctrl-V because the URL is stored on the clipboard.

Categories