Coder Social home page Coder Social logo

abjerner / skybrud.social Goto Github PK

View Code? Open in Web Editor NEW
96.0 16.0 35.0 15.64 MB

Skybrud.Social is a framework in .NET for integration with various social services like Twitter, Facebook and Instagram. The framework will handle all the technical parts and API communication so you don't have to.

Home Page: http://social.skybrud.dk/

License: MIT License

C# 99.50% JavaScript 0.41% Batchfile 0.10%
social skybrud limbo integrations api api-wrapper package facebook google instagram

skybrud.social's Introduction

Caution

Skybrud.Social is no longer in active development. You should instead look for our individual Skybrud.Social packages with similar functionality - e.g. Skybrud.Social.Facebook or Skybrud.Social.Instagram for Facebook and Instagram respectively.

For an updated list of all our Skybrud.Social packages, see our documentation at packages.limbo.works.

Skybrud.Social

GitHub license NuGet NuGet

Skybrud.Social in general is a framework in .NET for integration with various social services like Twitter, Facebook and Instagram. The framework will handle all the technical parts and API communication so you don't have to.

Notice As of v1.0, this repository and the corresponding package (Skybrud.Social.Core) will just contain the core functionality, and not the implementation for the individual services. Each supported service will now have it's own repository and package. You can find a list of supported services further down this page.

Installation

To install the core library of Skybrud.Social, simply pick one of the three methods below:

  1. NuGet Package
    Install this NuGet package in your Visual Studio project. Makes updating easy.
  2. ZIP file
    Grab a ZIP file of the latest release; unzip and move Skybrud.Social.Core.dll to the bin directory of your project.
  3. Builds
    I may occasional upload a build to Dropbox. These are builds in between releases, and are not tested at the same level as releases. As above, move Skybrud.Social.Core.dll to the bin directory of your project.

This will just install the core/base functionality. If you're looking for the implementation for a given service - eg. Facebook or Twitter, you will have to install a package for each service individually. For more information, have a look at the list of supported services.

v0.9.x?
For legacy reasons, you can still install the old Skybrud.Social NuGet package. As of v1.0 it's really just a dummy package, but with dependencies for Skybrud.Social.Core as well as Skybrud.Social.Facebook, Skybrud.Social.Twitter, Skybrud.Social.Instagram, Skybrud.Social.Google, Skybrud.Social.BitBucket, Skybrud.Social.GitHub and Skybrud.Social.Vimeo, which were all supported natively in v0.9.x.

Found a bug? Have a question?

Changelog

The releases page lists all releases since v0.1.1, where there will be some information for each release on the most significant changes.

Documentation

Improving the code has higher priority than documentation, so I'm currently a bit behind on the documentation. For the small amount of documentation already written, have a look at the Skybrud.Social website. The website will contain documentation for the core functionality as well as the implementation of the individual services.

Services

Package NuGet .NET Standard 1.3 .NET Framework 4.5 .NET Framework 4.6
Skybrud.Social.Core Install via NuGet
Skybrud.Social.BitBucket Install via NuGet
Skybrud.Social.Facebook Install via NuGet
Skybrud.Social.GitHub Install via NuGet
Skybrud.Social.Google Install via NuGet
Skybrud.Social.Instagram Install via NuGet
Skybrud.Social.LinkedIn Install via NuGet
Skybrud.Social.Meetup Install via NuGet
Skybrud.Social.Microsoft Install via NuGet
Skybrud.Social.Pinterest Install via NuGet
Skybrud.Social.Slack Install via NuGet
Skybrud.Social.Spotify Install via NuGet
Skybrud.Social.Twitter Install via NuGet
Skybrud.Social.Vimeo Install via NuGet

skybrud.social's People

Contributors

abjerner avatar digiogo avatar melvingr avatar rasmusfjord avatar rbrunge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skybrud.social's Issues

Less validation when parsing or initializing "AnalyticsMetric"

Google has added new metrics, and deprecated others, which I haven't yet had the time to update time.

The AnalyticsMetric class currently only allows instances of metrics that are already declared in Skybrud.Social, so calling AnalyticsMetric.Parse("ga:sessions") will throw an exception.

There should be a way to initialize new metrics that are not declared in my code.

The AnalyticsDimensions class shares the same problem.

FacebookDebugTokenResponse.cs is not found

Hey there,
Just looking around and found this file included in the solution but missing from source. Thanks for the library BTW. #h5yr
Error 1 Source file 'Facebook\Responses\Debug\FacebookDebugTokenResponse.cs' could not be found C:\Users\abjerner_wannabe\Documents\work\Skybrud.Social\src\Skybrud.Social\CSC Skybrud.Social

Facebook Login Issue

I've passed all parameters AppID and Secrete Code
Generated AccessToken and redirect url
When user login in facebook and redirect to website it will show error:

// Initialize the Facebook service (no calls are made here)
var service = FacebookService.CreateFromAccessToken(userAccessToken);
var user = service.Users.GetUser(); _HERE user = null_****

Enhancement Request: Facebook Comment & Like Counts

When accessing the feed for a page (maybe a profile as well? I'm not sure) the like and comment counts are not returned in the JSON so the count on the object is 0. Would you entertain the idea of adding two more calls to populate the comment and like counts?

You have to request the summary for the comments and likes to get the counts. Here are two example URLs:

https://graph.facebook.com/v2.1/{id_of_post_from_feed}/comments?limit=0&access_token={access_token}&summary=true
https://graph.facebook.com/v2.1/{id_of_post_from_feed}/likes?limit=0&access_token={access_token}&summary=true

This will return the following JSON containing no comments or likes, but will have the summary containing a field called total_count:

{
"data": [

],
"summary": {
"total_count": 349
}
}

With that total count you can then populate the comment and like counts automatically when populating the feed or they could be called separately. Probably separately I would imagine to cut down on calls to the API in case someone doesn't actually need the counts.

How to search the tweets based on maxid concepts

Hi,

I am using the below method to get the tweets based on hashatag but when i am querying again with refreshURL and the output is statuses is 0 but count its showing 15.

Please help me to resolve this problem.

TwitterSearchTweetsResponse tweetres = twitter.Search.GetTweets("#DIFF2014", 50);
string reurl = tweetres.MetaData.RefreshUrl.ToString();
TwitterSearchTweetsResponse tweetres1 = twitter.Search.GetTweets(reurl);

Thanks,

Add support for LinkedIn

I have some code lying around for this, that I need to finish and clean up a bit. This is probably something that will be added after the release of v1.0.

Facebook - some pages unable to be found

Hello again,

I've found another issue that isn't related to my earlier one, so I figured I would make a separate thread. My issue is that I am not able to find/display data from certain pages. I thought this might be some sort of permission problem, but I am able to find them using the graph API (both 2.2 and 2.4). It might be something they have in common that makes them unable to be found using the FacebookPostsResponse response = service.Posts.getPosts(pOptions), or it might be something entirely different.

I discovered this while looking for a page's likes, as not all of them were being included in the response.Body.Data of the likes response.

I have a few examples, see if you can return any data from them:
Page Name: counterstrike Id: 72493026282
Page Name: thewitcher Id: 9659019330
Page Name: fallout Id: 20320777672

source code zip file issue

Hi,

I took the zip file, extracted all the files and included in my solution

Below is the error i am getting while building the project Skybrud.Social.Core
Also,If i want to include any of the services like facebook.. i have to include those projects in my solution and refer those dlls in my project right?

Error 9 The command ""C:\Workspace\Skybrud.Social.PreBuildTool.exe" 2012-07-30 "C:\Workspace\ExternalModules\Skybrud.Social-master\src\Skybrud.Social.Core\Skybrud.Social.Core.csproj"

copy C:\Workspace\ExternalModules\Skybrud.Social-master\src\Skybrud.Social.Core\Properties\AssemblyInfoGenerated.cs C:\Workspace\Skybrud.Social\Properties\AssemblyInfoVersion.cs
copy C:\Workspace\ExternalModules\Skybrud.Social-master\src\Skybrud.Social.Core\Properties\AssemblyInfoVersion.cs C:\Workspace\Skybrud.Social\Properties\AssemblyInfoVersion.cs" exited with code 1. Skybrud.Social.Core (ExternalModules\Skybrud.Social\Skybrud.Social-master\src\Skybrud.Social.Core\Skybrud.Social.Core)

YouTube Videos

Hi,

I am trying to get the latest 5 videos of youtube for the user. I have the serverkey, browser key, userid. I would like to have a sample code for authenticating the google service using your library. I have a service with the methods for facebook,twitter, instagram and youtube. i was able to do it successfully for the other three social media using your library.

Also how do i get the latest videos published by the user.

Any help would be appreciated.

Code that i have for youtube service
GoogleService googleService = GoogleService.CreateFromServerKey(youTubeApiServerKey);
YouTubePlaylistListOptions playListOptions = new YouTubePlaylistListOptions()
{
Part = new YouTubePlaylistPartsCollection("snippet"),
Mine = true
};

        YouTubePlaylistListResponse playListResponse = googleService.YouTube.Playlists.GetPlaylists(playListOptions);

        //// Iterate through the playlist items
        foreach (YouTubePlaylist playListItem in playListResponse.Body.Items)
        {

            YouTubePlaylistItemListOptions options = new YouTubePlaylistItemListOptions()
            {
                Part = new YouTubePlaylistItemPartsCollection("contentDetails", "snippet"),
                PlaylistId = playListItem.Id

            };

            YouTubePlaylistItemListResponse response = googleService.YouTube.PlaylistItems.GetPlaylistItems(options);
                //Playlists.GetPlaylists(options);

            //// Iterate through the playlist items
            foreach (YouTubePlaylistItem item in response.Body.Items)
            {
                // Do something with the post  
                SocialWallModel socialWallModel = new SocialWallModel();

                if (item.Snippet != null)
                {
                    socialWallModel.Title = item.Snippet.Title;
                    socialWallModel.Text = item.Snippet.Description;
                    socialWallModel.Date = item.Snippet.PublishedAt;
                }

                socialWallModel.ThumbURL = string.Format("https://www.youtube.com/watch?v={0}", item.Id);
                socialWallModel.SocialFeedtype = SocialType.YouTube;
                socialWallModel.Icon = icon;
                socialWallModel.Link = string.Format("https://www.youtube.com/watch?v={0}", item.Id);
                socialWallModelList.Add(socialWallModel);

            }
        }

Thanks,
Deepa

service.Tags.GetRecentMedia("tag_name") changed?

Hi,

I coded a script to get recent media that contains a specific tag. It was working perfectly.

Unfortunately, some days ago I realized that the script is returning only recent media from the user account (the one that provided the access token).

Is there any change on Instagram API or Skybrud regarding to getting recent media? I search on Instagram Developers website and didn't find any news.

The steps I'm following to replicate the problem are:

1- Create a new service using an access token
2- Getting recent media by using -----> media = service.Tags.GetRecentMedia("tag");
3- The result is that I only get media from the user that created the service (previously I was getting ALL recent media from ANY user following exactly the same steps)

Any idea about why I'm only getting recent media from one user and not any user?

Thanks!

Mac.

Tags sometimes null when getting videos - NullReferenceException

\Vimeo\Simple\Objects\VimeoVideo.cs line 93:

Tags = obj.GetArray("tags").Cast()

Sometimes obj.GetArray("tags") is null and causes a NullReferenceException.

Here is some code to reproduce the issue:

        var vimService = new VimeoService();
        VimeoChannel vimChannel = vimService.GetChannelInfo("fixedgearculture");

        string testOutput = string.Empty;

        for (int page = 1; page <= 3; page++)
        {
            VimeoChannelVideosResponse vimVideos = vimService.GetChannelVideos(vimChannel.Id, page);

            testOutput += string.Format("Page: {0}\r\n----------\r\n", page);
            foreach (var video in vimVideos.Videos)
            {
                testOutput += video.Title + "\r\n";
            }

            testOutput += "\r\n";
        }

Updated line 93 to the following as a test and it fixed the issue:

Tags = obj.GetArray("tags") == null ? new string[] {} : obj.GetArray("tags").Cast<string>()

Enhancement Request: Facebook Talking About Count

When requesting information about a Facebook page through Methods.GetUser() the talking_about_count is returned by Facebook, but is not part of the FaceBookUser object. Would it be possible to have that added to the object since the data is available already?

Add CreateFromClientId method to InstagramService class.

The InstagramService class can currently only be initialized by calling either CreateFromAccessToken(string accessToken) or CreateFromOAuthClient(InstagramOAuthClient client).

Since it is possible to use a client ID instead of an access token, a CreateFromClientId(string clientId) method should be implemented as well.

Instagram Missing InstagramScope Enum options

I need to add multiple scopes when getting the Instagram authorization url. Two important ones I need are not in the list. follower_list & public_content. (See: https://www.instagram.com/developer/authorization/)

I cloned your repo here and was going to make the changes and submit a pull request but I wasn't able to find where the enum InstagramScope is defined and used. I also need to overload the GetAuthorizationUrl() method to accept an array of Scopes.

Can you help? :-) I must not be looking in the right place. Your Skybrud.Social.Core project doesn't seem to have the code specific to the different social networks.

image

Error in Authorize Facebook account on Localhost

Hi,
I installed the plugin on Umbraco7.2.8 and I run into the following error when trying to Authorize my account:
Invalid Scopes: read_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions

For Redirect URI I used: www.mylocalsite.com/App_Plugins/Skybrud.Social/Dialogs/FacebookOAuth.aspx
Both in Umbraco backoffice and on FB developer site.

Help is needed,
Thanks.

Enhancement Request: Instagram Counts on User Object

There is a Counts object returned in the JSON which contains the total media count for the user, the number of people following the user, and the number of people the user is following. If that could be added in it would be great.

Thanks again for all of your work on this project!

Twitter Search on regular interval

Hello,

I have an issue while searching tweets for a keyword. I am searching for a keyword on regular interval.

ex: am setting count as 10. actually the key word is available in 13 tweets.So for the first run i am getting 10 and for second run am passing last maxid to the option property, so am getting remaining 3. in the mean time one more tweet has tagged with my search keywork. so how can get only newly added tweet based on my last maxID. As now the method doesnt return the last one. Instead it does zero count for last maxID.

Here is my sample code: Please correct me...

private string callthismethod(string maxId)
{
TwitterOAuthClient information = new TwitterOAuthClient
{
ConsumerKey = "key",
ConsumerSecret = "secret"

           };

        TwitterService twitter = TwitterService.CreateFromOAuthClient(information);
        TwitterSearchTweetsResponse response;
        TwitterSearchTweetOptions options = new TwitterSearchTweetOptions
        {
            Query = "mysearch",
            ResultType = TwitterSearchTweetResultType.Mixed,
            Count = 10,
        };

        if (string.IsNullOrEmpty(maxId))
        {
            response = twitter.Search.GetTweets(options);
        }
        else
        {
            options.MaxId = Convert.ToInt64(maxId);
            response = twitter.Search.GetTweets(options);
        }
        if (response.Statuses.Count() > 0)
        {
            return (response.Statuses.Last().Id - 1).ToString();
        }
        else
        {
            return maxId;
        }
    }

Thanks
Arun

Can't compile out-of-the-box

Seems like a great thing! Looking forward to try it in my current project.

However, Got this one right after downloading & compiling:

The command "D:\Temp.netsocial\src\Skybrud.Social.PreBuildTool.exe D:\Temp.netsocial\src" exited with code 9009. Skybrud.Social

How to access the google web analytics data

Hi,

Could please provide some sample code, how to authenticate and get the data from Google web analytics?

I want create a dashboard with chart options for one web site analytics, can you please help me how to use your dll for Google analytics.

Thanks,

Possible to change API version?

This 2.4 "optimization" from Facebook really bums me out since GetPosts doesn't support fields yet.

However is it possible to specify with some kind of option to use 2.3 until skybrud is 100% compatible? It shouldn't shut down until 2017 something.

Cheers!

Enhancement Request: Facebook GetPosts Options

GetPosts should allow the options to be set just like GetFeed as they are essentially the same except that /posts only shows posts by that user/page whereas /feed can also show posts from other users/pages.

CreatedAt string from Twitter is sometimes null

TwitterUtils.ParseDateTime throws a null reference exception at times because of a null string from Twitter. I don't know if this is the same for the ParseDateTimeUtc when parsing the date/time string for tweets, but I would assume it could be an issue as well.

Facebook API

Hi Abjerner,

For the past few days, I have been learning how to use your library for Twitter, Instagram and Facebook. I'm really glad that this library have helped me out by making the data retrieval so much easier on asp.net. So far, Twitter and Instagram have no problems, except for Facebook.

I used the reference from the Object-oriented communication codes as shown on the image and I entered the access token and user id. However, i can't seem to retrieve any data out and there isn't any errors shown. So, I'm curious whether if the samples codes provided below is sufficient or is there more codes that I have to add on in order to retrieve the data.

Thanks!

image

next release

Hey there, How close do you think you are to a new release?
Do you have a list of things to do?

Facebook.Likes.Count and Facebook.Comments.Count are always returning 0

In 0.9.3 FacebookPost.Likes.Count and FacebookPost.Comments.Count are returning 0

The FacekbookLikes call and the FacebookComments calls are trying to parse the "count" property the same way you changed Shares to work in 0.9.3 using:

Count = obj.GetInt32("count")

but neither Likes or Shares have a "count" property in the JsonObject so they are both returning 0.

Add support for video information of an extended media entity

For an extended media that is a Twitter video, information about that video is provided in the JSON.

Here is an example of such an entity (see tweet):

{
  "id": 655135486290190336,
  "id_str": "655135486290190336",
  "indices": [
    79,
    101
  ],
  "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/655135486290190336/pu/img/hHLh66w9FaS68YFW.jpg",
  "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/655135486290190336/pu/img/hHLh66w9FaS68YFW.jpg",
  "url": "http://t.co/ehuTMgaBc6",
  "display_url": "pic.twitter.com/ehuTMgaBc6",
  "expanded_url": "http://twitter.com/EA/status/655135503906304000/video/1",
  "type": "video",
  "sizes": {
    "thumb": {
      "w": 150,
      "h": 150,
      "resize": "crop"
    },
    "medium": {
      "w": 600,
      "h": 338,
      "resize": "fit"
    },
    "small": {
      "w": 340,
      "h": 191,
      "resize": "fit"
    },
    "large": {
      "w": 1024,
      "h": 576,
      "resize": "fit"
    }
  },
  "video_info": {
    "aspect_ratio": [
      16,
      9
    ],
    "duration_millis": 6000,
    "variants": [
      {
        "content_type": "application/dash+xml",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/pl/vRPv3nIY-f7OkpbI.mpd"
      },
      {
        "bitrate": 832000,
        "content_type": "video/webm",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/640x360/6iC_TY0KtZp34u6g.webm"
      },
      {
        "content_type": "application/x-mpegURL",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/pl/vRPv3nIY-f7OkpbI.m3u8"
      },
      {
        "bitrate": 320000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/320x180/MI3d_0UidfGUYcLa.mp4"
      },
      {
        "bitrate": 832000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/640x360/6iC_TY0KtZp34u6g.mp4"
      },
      {
        "bitrate": 2176000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/1280x720/UZAAUpdK56pYP7J7.mp4"
      }
    ]
  }
}

Facebook - how to get a list of posts with specific fields from a feed

Hi there,
I've been playing around with both the Skybrud.Social Instagram and Facebook API's for a bit, and had a few questions about Facebook.

I am currently able to get a list of posts (with specified fields) from a Facebook page (i.e all posts the admin of the page had made) with no problems, but I was wondering how I would get a list of posts from the feed of a Facebook page (i.e every post that has been posted to that page, be it from the admin or other users). Looking at the graph API explorer it seems possible, but is there a way to do this with the current Skybrud.Social API?

In addition, I would like to make the list of posts from the feed with the same specific fields as the regular list of posts. Looking through the FacebookFeedOptions, there didn't seem like a way to specify fields in a feed the same way you can with the FacebookGetPostsOptions in a post. I tried modifying the FacebookFeedOptions in the dll to include these options, but I do not know how I would go about adding the response.Body.Data to a list (unsure of which list type to use).

Perhaps I'm going about this all wrong, but here is what I am attempting to do:
(Apologies for syntax, I believe this is my first post)

FacebookFeedOptions fOptions = new FacebookFeedOptions() {
    Fields = "id,message,from,created_time,object_id,type",
    Limit = 5
}
FacebookFeedResponse response = service.Feed.GetFeed(pageName,fOptions);

After modifying the dll, these appear to be fine. I just don't know what type of list I would add the response.Body.Data to.

Sorry for the long post!

pictures from facebook

Do you know how to get images from facebook for posts with a video in it?
Do I need to make another call to get the thumbnail for the video?
I currently make the following call and the picture that comes back is not returning any data :(

var posts = service.Posts.GetPosts(user.Id, 50).Body.Data;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.