Skip to content

Commit

Permalink
Socioboard 3.0 update
Browse files Browse the repository at this point in the history
Socioboard 3.0 update
  • Loading branch information
swetasb committed Nov 20, 2017
1 parent 82e8335 commit 0ed96fa
Show file tree
Hide file tree
Showing 47 changed files with 19,351 additions and 371 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
24 changes: 22 additions & 2 deletions src/Api.Socioboard/Controllers/GoogleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ public IActionResult EnableDisableGoogleSignIn(long userId,string GplusId, bool
{
if (checkEnable)
{
return Ok("Cool! Social SignIn has Enable for Google Account ");
return Ok("You have successfully enabled social sign in for Google Account");
}
else
{
return Ok("You have Successfully Disabled Social SignIn for Google Account");
return Ok("You have successfully disabled social sign in for Google Account");
}

}
Expand Down Expand Up @@ -1140,5 +1140,25 @@ public IActionResult uploadyoutube(string channelid, string title, string descri
}
}


[HttpGet("GetAllYtComments")]
public IActionResult GetAllYtComments(string ChannelId)
{
return Ok(Repositories.GplusRepository.GetAllYoutubeComments(ChannelId, _redisCache, _appSettings));
}

[HttpGet("GetYtVdoCommentsWithReply")]
public IActionResult GetYtVdoCommentsWithReply(string VideoId)
{
return Ok(Repositories.GplusRepository.GetYoutubeCommentsWithReply(VideoId, _redisCache, _appSettings));

}
[HttpPost("PostCommentsYoutubeReply")]
public IActionResult PostCommentsYoutubeReply(string channelId, string idParentComment, string commentText, string videoId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
Repositories.GplusRepository.PostCommentsYtReply(channelId, idParentComment, commentText, videoId, _appSettings, _logger, dbr);
return Ok("");
}
}
}
61 changes: 61 additions & 0 deletions src/Api.Socioboard/Controllers/LinkedInController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Text.RegularExpressions;
using MongoDB.Driver;
using System.Collections.Specialized;
using Api.Socioboard.Helper;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

Expand Down Expand Up @@ -287,7 +288,67 @@ public IActionResult GetLinkdeinPagePostComment(string pageId, long userId, stri
[HttpPost("PostCommentOnLinkedinCompanyPage")]
public IActionResult PostCommentOnLinkedinCompanyPage(string pageId,long userId,string updatekey,string comment)
{
string postmessage = "";
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
string[] updatedmessgae = Regex.Split(comment, "<br>");
foreach (var item in updatedmessgae)
{
if (!string.IsNullOrEmpty(item))
{
if (item.Contains("https://") || item.Contains("http://"))
{
try
{
comment = "http" + Utility.getBetween(item, "http", " ");
try
{
comment = comment.Split(' ')[0].ToString();
}
catch (Exception)
{

comment = "http" + Utility.getBetween(item, "http", " ");
}
}
catch
{
string temp_item = item + "###";
comment = "http" + Utility.getBetween(temp_item, "http", "###");
try
{
comment = comment.Split(' ')[0].ToString();
}
catch (Exception)
{

comment = "http" + Utility.getBetween(temp_item, "http", "###");
}
}
}
if (item.Contains("hhh") || item.Contains("nnn"))
{
if (item.Contains("hhh"))
{
postmessage = postmessage + "\n\r" + item.Replace("hhh", "#");
}
}
else
{
postmessage = postmessage + "\n\r" + item;
}
}
}
try
{
comment = "";
//updatedtext = postmessage.Replace(url, "");
// updatedtext = postmessage;
comment = postmessage;
}
catch (Exception ex)
{
comment = postmessage;
}
string postdata = Repositories.LinkedInAccountRepository.PostCommentOnLinkedinCompanyPage(pageId, updatekey, comment, userId, _redisCache, _appSettings, dbr);
return Ok(postdata);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Api.Socioboard/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1297,11 +1297,11 @@ public IActionResult EnableDisableSocialLogin(long userId,string facebookid, boo
{
if (checkEnable)
{
return Ok("You have successfully enabled Social Signin for facebook account enjoy login without id and pass");
return Ok("You have successfully enabled social sign in for Facebook account, you can now access without login id and password");
}
else
{
return Ok("You have successfully disabled Social signin for facebook account");
return Ok("You have successfully disabled Social sign in for Facebook account");
}

}
Expand Down
71 changes: 71 additions & 0 deletions src/Api.Socioboard/Controllers/YoutubeGroupController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Logging;
using Domain.Socioboard.Interfaces.Services;
using Microsoft.AspNetCore.Hosting;
using Api.Socioboard.Model;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Api.Socioboard.Controllers
{
[EnableCors("AllowAll")]
[Route("api/[controller]")]
public class YoutubeGroupController : Controller
{
public YoutubeGroupController(ILogger<UserController> logger, IEmailSender emailSender, IHostingEnvironment appEnv, Microsoft.Extensions.Options.IOptions<Helper.AppSettings> settings)
{
_logger = logger;
_emailSender = emailSender;
_appEnv = appEnv;
_appSettings = settings.Value;
_redisCache = new Helper.Cache(_appSettings.RedisConfiguration);

}
private readonly ILogger _logger;
private readonly IEmailSender _emailSender;
private readonly IHostingEnvironment _appEnv;
private Helper.AppSettings _appSettings;
private Helper.Cache _redisCache;


[HttpPost("InviteGroupMember")]
public IActionResult InviteGroupMember(Int64 userId, string emailId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
Repositories.YoutubeGroupRepository.InviteGroupMember(userId, emailId, _appSettings, _logger, dbr);
return Ok("");
}

[HttpGet("GetGroupMember")]
public ActionResult GetGroupMember(long userId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
//IList<Domain.Socioboard.Models.YoutubeGroupInvite> grppMembers = Repositories.YoutubeGroupRepository.GetGroupMembers(channelId, _appSettings, _logger, dbr);
IList<Domain.Socioboard.Models.YoutubeGroupInvite> grppMembers = Repositories.YoutubeGroupRepository.GetGroupMembers(userId, _appSettings, _logger, dbr);
return Ok(grppMembers);
}

[HttpGet("GetYtGroupChannel")]
public ActionResult GetYtGroupChannel(Int64 userId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
IList<Domain.Socioboard.Models.Groupprofiles> grppMembers = Repositories.YoutubeGroupRepository.GetYtGroupChannel(userId, _appSettings, _logger, dbr);
return Ok(grppMembers);
}

[HttpGet("GetYtYourGroups")]
public ActionResult GetYtYourGroups(Int64 userId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
IList<Domain.Socioboard.Models.YoutubeGroupInvite> grppMembers = Repositories.YoutubeGroupRepository.GetYtYourGroups(userId, _appSettings, _logger, dbr);
return Ok(grppMembers);
}


}
}
13 changes: 12 additions & 1 deletion src/Api.Socioboard/Repositories/FacebookRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,11 @@ public static void SaveFacebookFeeds(string AccessToken, string ProfileId, Helpe
// objFacebookFeed.sharedate = DateTime.UtcNow;//this is feed date value for share feed in another socail media
//}
//catch { }
objFacebookFeed._facebookComment = FbPostComments(objFacebookFeed.FeedId, AccessToken, settings, _logger);
//objFacebookFeed._facebookComment = FbPostComments(objFacebookFeed.FeedId, AccessToken, settings, _logger);

objFacebookFeed._facebookComment = FbPostComments(objFacebookFeed.FeedId, result["comments"], settings, _logger);


try
{
MongoRepository mongorepo = new MongoRepository("MongoFacebookFeed", settings);
Expand Down Expand Up @@ -1936,6 +1940,13 @@ public static List<MongoFbPostComment> FbPostComments(string postid, string Acce
public static string DeleteProfile(Model.DatabaseRepository dbr, string profileId, long userId, Helper.Cache _redisCache, Helper.AppSettings _appSettings)
{
Domain.Socioboard.Models.Facebookaccounts fbAcc = dbr.Find<Domain.Socioboard.Models.Facebookaccounts>(t => t.FbUserId.Equals(profileId) && t.UserId == userId && t.IsActive).FirstOrDefault();
Domain.Socioboard.Models.User user = dbr.Find<Domain.Socioboard.Models.User>(t => t.Id.Equals(userId) && t.EmailId == fbAcc.EmailId && t.EmailValidateToken == "Facebook").FirstOrDefault();
if (user != null)
{
dbr.Delete<Domain.Socioboard.Models.User>(user);
_redisCache.Delete(Domain.Socioboard.Consatants.SocioboardConsts.CacheFacebookAccount + userId);
}

if (fbAcc != null)
{

Expand Down
Loading

0 comments on commit 0ed96fa

Please sign in to comment.