Share link to social media from Phone - c#

i am developing an app in wp7, which gives you the ability to post on social networks, the song you are listening with name, description and link!
The app is writen with # for Windows Phone and it use
ShareLinkTask shareLinkTask = new ShareLinkTask();
to post the link of song from YouTube!
The format of post is like:
Link = SONGLINK
Message = Listening now: SONGNAME from APP(APPLINK)
The problem is that when i post to facebook the SONGLINK does not have a preview, so is displayed like APPLINK in text-blue-hyperlink with border!
I think is like facebook gets the link but not loads the preview...
I also tried to post facebook via the Facebook app (Microsoft's) and i got the same result, so the app has not problem but the facebook service?
Problem it seems to be from facebook as when i am working with twitter i have the preview with the same code sample!
So any ideas?

Problem it seem to be solved from facebook after some days, it seems that this happend due maintence of the facebook page.

Related

Retrieve photos from Facebook/Instagram

I am looking to retrieve photos from Facebook and Instagram for viewing in a WPF application. The idea behind is to show user existing photos and allow them to upload more using C#. A bonus would be to let the user delete photos and set their profile picture, but is not a must.
I cannot find any APIs for either Facebook or Instagram for use in a WPF application, and the ones I did find were all for web (ASP.NET/PHP).
Is there such an API and how might I go about doing this?
Looks like they have what you're looking for in the Graph API:
https://developers.facebook.com/docs/graph-api/reference/user/photos/
Facebook Graph .NET API.
Using the Facebook .NET SDK
Here is an example I whipped up, haven't tested. Should work though. It retrieves the profile picture of a user. Though if you read through the APIs you can adapt it for whatever you need.
var client = new FacebookClient("accessToken");
object taskResult = await client.GetTaskAsync("/me");
var result = (IDictionary<string, object>)taskResult;
var userId = taskResult.Where(s=>s.Key == "id").First().Value
var profilePicUrl = string.Format("https://graph.facebook.com/{0}/picture", userId);
Facebook SDK
For instagram
This link will help you embeding the instagram on a simple html webpage.
There is a button on the bottom of the post on instagram.when you click on the link a menu pops up. then click on embed
now a box pops up
just copy paste the html and you are done.
it will fetch the post for you

What are the ways to post a tweet to twitter with asp.net c#? [duplicate]

With Twitter's new OAuth interface, their API is now many times more complex than what it was. And I haven't even looked at Facebook's API yet.
What I'm wondering if there is a method that employs some higher-level, existing code or interfaces to make this a simpler task.
All I want to be able to do is initiate a Twitter tweet or Facebook share on the user's behalf and be able to control the initial text of those messages, from an ASP.NET application.
I found some similar questions on SO, but they had no answers.
EDIT: I know there are things like AddThis and ShareThis, but I need something that will give me control over the default message. It must contain a link with a code that is specific to the current user.
Twitter Integration...
For making Tweets from an ASP.NET application on users' behalf, check out Twitterizer. It's a free, open-source project for integrating with Twitter from .NET applications.
I agree that using OAuth can be a bit daunting, but the Twitterizer API wraps up most of the complexity. I've written an article on using Twitterizer in an ASP.NET application that you may be interested in: Integrating Twitter Into An ASP.NET Website Using OAuth. After reading the article, download the code sample at the end, which is a working demo showing how to use Twitterizer to post a tweet from an ASP.NET website.
Facebook Integration...
For integrating with Facebook, chcek out the Facebook Developer Toolkit. Like Twitterizer, it's an open-source, free API and should get you going in the right direction.
Happy Programming!
After looking around for a while, I found sharethis.com. They have various share buttons you can add to your site that send Twitter tweets, Facebook shares, etc.
It looks like it also supports options to control the URL, so I could modify this to include whatever URL I need.
I haven't yet figured out if I can control the default message text. I'm looking into that.
But it seems like this is probably the simplest way to accomplish what I want.
This is probably what you're after for twitter: https://twitter.com/about/resources/buttons#tweet
Let's you configure a button (or URL to redirect to) that starts the user off with some default text. The user can change the text before they post.
Don't know about facebook.
Twitter Integration:
Check this code and link/article simple and easy :
protected void btnTweet_Click(object sender, EventArgs e)
{
string oauthAccessToken = Session["twtoken"].ToString();
string oauthAccessTokenSecret = Session["twsecret"].ToString();
OAuthHelper oauthhelper = new OAuthHelper();
oauthhelper.TweetOnBehalfOf(oauthAccessToken, oauthAccessTokenSecret, txtTweet.Text);
if (string.IsNullOrEmpty(oauthhelper.oauth_error))
Response.Write("Twit Posted Successfully");
else
Response.Write(oauthhelper.oauth_error);
}
Read more how to get access token and secret key and download OAuthHelper and OAuthUtility Class below is the link -
How to post tweet on behalf of an user from asp.net using oauth authentication
Login with twitter using oauth authentication in asp.net and get access token, screen name and userid

Vimeo Search API implementation for Windows Phone 8

I am in a process to develop an app in which the user would enter some text into the textbox . On click of search button , the application fetches list of all videos with details like link , thumbnail and title related to the input. Just like we do in youtube.
I want to bind that data to listbox .
My problem is I am unable to start with it. I have registered my app but do I need client Key and all because I am accessing public videos.
Any help would be appreciated
PS: I am able to do this with youtube. I want JSON data which I can bind.
Thanks
You can generate an unauthenticated token, and use it forever (it will not expire).
There is additional documentation here: https://developer.vimeo.com/api/authentication#unauthenticated-requests

Facebook Posts via 3rd Party Scheduler not visible to people

I am posting on my facebook page using 3rd Party Scheduler but I am guessing the post is not visible to people. I am not getting views on those posts or any interactions.
I am using Facebook C# SDK. Below is the snippet of the code, where 'file' is FacebookMediaStream object.
var fb = new FacebookClient(pageAccessToken);
result = fb.Post(mapping.pageId + "/photos",
new
{
message = 'Demo Title',
file
});
The post does appear on the page feed but I am guessing not on the people's newsfeed since there aren't any views for the posts.
Is there any change in EdgeRank algorithm or some parameter issue while posting it to FB?
Cheers
The same happened to me trying to use php sdk to post on a group feed. The issue was that the application was in development mode. You can check it in the app dashboard near the name of the app (a green circle).

Facebook login page is mirrored when in RTL

I've set my WP8 app to be RTL (right to left) and than used the Facebook c# SDK for WP8.
This is my relevant Facebook c# code:
session = await FacebookSessionClient.LoginAsync();
Now the problem is that the Facebook log in page is all mirrored and unlike the WP8 mirror the texts are also mirrored so they are sort of "backwards".
Is it a bug or can I fix it?
Got it :)
Before the line in the question I added this:
App.RootFrame.FlowDirection = System.Windows.FlowDirection.LeftToRight;
To return the app into LTR so the Facebook page will be formatted correctly and not mirrored.
In order to return it after the login had finished I added this line when I finished with the login:
App.RootFrame.FlowDirection = System.Windows.FlowDirection.RightToLeft;
It happend because the facebook login page is shown inside a Browser control so the actual text doesn't get mirrored correctly.
I guess the Facebook C# SDK people should have thought of it.. so I think we can say it sort of a bug.
Hope I helped you, future viewers!

Categories

Resources