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 Feb 19, 2018
1 parent f2b350c commit a937795
Show file tree
Hide file tree
Showing 87 changed files with 2,688 additions and 1,634 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

*.txt
*.jpg
*.mp4
*.png
*.jpeg
*.gif
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
7 changes: 4 additions & 3 deletions src/Api.Socioboard/Controllers/BoardMeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public IActionResult getBoardByName(string boardName)
public IActionResult getBoardFeedsByName(string boardName)
{
boardName = boardName.Replace("SB", "/");
boardName = boardName.Replace("____", "\\");
try
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
Expand Down Expand Up @@ -325,7 +326,7 @@ public IActionResult getTwitterFeeds(long boardId, int skip, int count)
//});
//IList<MongoBoardTwtFeeds> objTwitterPagelist = task.Result;
//List<MongoBoardTwtFeeds> objBoardGplusPagefeeds = objTwitterPagelist.OrderByDescending(t => t.Publishedtime).Skip(Convert.ToInt32(skip)).Take(Convert.ToInt32(count)).ToList();
var result = boardrepo.FindWithRange<MongoBoardTwtFeeds>(t => t.Twitterprofileid.Equals(board.twitterHashTag), sort, skip, count);
var result = boardrepo.FindWithRange<MongoBoardTwtFeeds>(t => t.Twitterprofileid.Equals(board.twitterHashTag) && t.Feedurl!=null, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
Expand Down Expand Up @@ -363,7 +364,7 @@ public IActionResult getInstagramFeeds(long boardId, int skip, int count)
//});
//IList<MongoBoardInstagramFeeds> objTwitterPagelist = task.Result;
//List<MongoBoardInstagramFeeds> objBoardGplusPagefeeds = objTwitterPagelist.OrderByDescending(t => t.Publishedtime).Skip(Convert.ToInt32(skip)).Take(Convert.ToInt32(count)).ToList();
var result = boardrepo.FindWithRange<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag), sort, skip, count);
var result = boardrepo.FindWithRange<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag) && t.Link!=null, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
Expand Down Expand Up @@ -401,7 +402,7 @@ public IActionResult getGplusfeeds(long boardId, int skip, int count)
//});
//IList<MongoBoardGplusFeeds> objTwitterPagelist = task.Result;
//List<MongoBoardGplusFeeds> objBoardGplusPagefeeds = objTwitterPagelist.OrderByDescending(t => t.Publishedtime).Skip(Convert.ToInt32(skip)).Take(Convert.ToInt32(count)).ToList();
var result = boardrepo.FindWithRange<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag), sort, skip, count);
var result = boardrepo.FindWithRange<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag) && t.Feedlink!=null, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
Expand Down
2 changes: 1 addition & 1 deletion src/Api.Socioboard/Controllers/InstagramController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ public IActionResult GetInstaAccSingle(string accId)
return Ok(pageDetails);
}
}
}
}
4 changes: 2 additions & 2 deletions src/Api.Socioboard/Controllers/NotificationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public IActionResult ChangePasswordDetail(long userId)
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
List<Domain.Socioboard.Models.Facebookaccounts> datalst = dbr.Find<Facebookaccounts>(t => t.UserId == userId).ToList();
Domain.Socioboard.Models.User userDet = dbr.FindSingle<User>(t => t.Id == userId);
var result = mongorepo.Find<Domain.Socioboard.Models.Mongo.FacebookPasswordChangeUserDetail>(t => t.userId == userId && t.status==false && t.fbAccEmail !=null);
var result = mongorepo.Find<Domain.Socioboard.Models.Mongo.FacebookPasswordChangeUserDetail>(t => t.userId == userId && t.status==false);
var task = Task.Run(async () =>
{
return await result;
Expand All @@ -161,7 +161,7 @@ public IActionResult ChangePasswordDetail(long userId)

if (count>0)
{
return Ok(lstfbpasschange);
return Ok(userDet);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public IActionResult SavePost(SavedFeedsManagement objData, IFormFile files)
return Ok(status);
}

[HttpPost("DeletePost")]
public IActionResult DeletePost(string postId)
{
bool status = SavedFeedsManagementRepository.DeletePost(postId, _appSettings);
return Ok(status);
}

[HttpPost("SaveComment")]
public IActionResult SaveComment(SavedFeedsComments objData)
{
Expand Down
10 changes: 8 additions & 2 deletions src/Api.Socioboard/Controllers/SocialMessagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId
Domain.Socioboard.Models.Facebookaccounts objFacebookAccount = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(prId, _redisCache, dbr);
string ret = Helper.FacebookHelper.ComposeMessage(objFacebookAccount.FbProfileType, objFacebookAccount.AccessToken, objFacebookAccount.FbUserId, updatedtext, prId, userId, uploads, link, mediaType, objFacebookAccount.FbUserName, dbr, _logger);

}).Start();
}).Start();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -336,6 +336,12 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId
[HttpPost("ScheduleMessage")]
public async Task<ActionResult> ScheduleMessage(string message, string profileId, long userId, string imagePath, string link, string scheduledatetime, string localscheduletime, IFormFile files, string messageText, Domain.Socioboard.Enum.MediaType mediaType)
{

string updatemessage = Request.Form["messageText"];
if (message == "none")
{
messageText = updatemessage;
}
message = messageText;
var filename = "";
string postmessage = "";
Expand Down Expand Up @@ -503,7 +509,7 @@ public async Task<ActionResult> ScheduleMessage(string message, string profileId
link = linkurl;
string prId = item.Substring(6, item.Length - 6);
Domain.Socioboard.Models.Facebookaccounts objFacebookaccounts = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(prId, _redisCache, dbr);
Helper.ScheduleMessageHelper.ScheduleMessage(prId, objFacebookaccounts.FbUserName, "", Domain.Socioboard.Enum.SocialProfileType.Facebook, userId, link, filename, "https://graph.facebook.com/" + prId + "/picture?type=small", scheduledatetime, localscheduletime, mediaType, _appSettings, _redisCache, dbr, _logger);
Helper.ScheduleMessageHelper.ScheduleMessage(prId, objFacebookaccounts.FbUserName, link, Domain.Socioboard.Enum.SocialProfileType.Facebook, userId, link, filename, "https://graph.facebook.com/" + prId + "/picture?type=small", scheduledatetime, localscheduletime, mediaType, _appSettings, _redisCache, dbr, _logger);
}
catch (System.Exception ex)
{
Expand Down
43 changes: 43 additions & 0 deletions src/Api.Socioboard/Controllers/TwitterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,48 @@ public IActionResult deleteTwtFeed(string profileId ,string messageId)
return Ok();
}


//[HttpGet("feeds")]
//public IActionResult feeds(string profileId)
//{
// oAuthTwitter OAuth = new oAuthTwitter(_appSettings.twitterConsumerKey, _appSettings.twitterConsumerScreatKey, _appSettings.twitterRedirectionUrl);
// DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv);
// IList<Domain.Socioboard.Models.TwitterAccount> TwtAccounts =dbr.Find<Domain.Socioboard.Models.TwitterAccount>(t => t.twitterUserId== profileId).ToList();
// foreach (var item in TwtAccounts)
// {
// OAuth.AccessToken = item.oAuthToken;
// OAuth.AccessTokenSecret = item.oAuthSecret;
// OAuth.TwitterScreenName = item.twitterScreenName;
// }
// return Ok(Repositories.TwitterRepository.feedsss(profileId, OAuth.TwitterScreenName, OAuth, _logger, _appSettings));

//}

//[HttpGet("searchkeyword")]
// public IActionResult searchkeyword(string profileId,string keyword)
// {
// oAuthTwitter OAuth = new oAuthTwitter(_appSettings.twitterConsumerKey, _appSettings.twitterConsumerScreatKey, _appSettings.twitterRedirectionUrl);
// DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
// IList<Domain.Socioboard.Models.TwitterAccount> TwtAccounts = dbr.Find<Domain.Socioboard.Models.TwitterAccount>(t => t.twitterUserId == profileId).ToList();
// foreach (var item in TwtAccounts)
// {
// OAuth.AccessToken = item.oAuthToken;
// OAuth.AccessTokenSecret = item.oAuthSecret;
// OAuth.TwitterScreenName = item.twitterScreenName;
// }
// return Ok(Repositories.TwitterRepository.keywords(profileId, OAuth.TwitterScreenName, OAuth,keyword));

// }

[HttpGet("GettwitterSingle")]

public IActionResult GettwitterSingle(string profileId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
Domain.Socioboard.Models.TwitterAccount AccDetails = dbr.Single<Domain.Socioboard.Models.TwitterAccount>(t => t.twitterUserId == profileId);
return Ok(AccDetails);

}

}
}
4 changes: 2 additions & 2 deletions src/Api.Socioboard/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public IActionResult Register(User user)
html = html.Replace("[FirstName]", nuser.FirstName);
html = html.Replace("[AccountType]", nuser.AccountType.ToString());
html = html.Replace("[ActivationLink]", _appSettings.Domain + "/Home/Active?Token=" + nuser.EmailValidateToken + "&id=" + nuser.Id);
_emailSender.SendMailSendGrid(_appSettings.frommail, "", nuser.EmailId, "", "", "Socioboard Email conformation Link", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
_emailSender.SendMailSendGrid(_appSettings.frommail, "", nuser.EmailId, "", "", "Socioboard Email confirmation Link", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
}
catch
{
Expand Down Expand Up @@ -175,7 +175,7 @@ public IActionResult PhoneSignUp(User user)
html = html.Replace("[FirstName]", nuser.FirstName);
html = html.Replace("[AccountType]", nuser.AccountType.ToString());
html = html.Replace("[ActivationLink]", _appSettings.Domain + "/Home/Active?Token=" + nuser.EmailValidateToken + "&id=" + nuser.Id);
_emailSender.SendMailSendGrid(_appSettings.frommail, "", nuser.EmailId, "", "", "Socioboard Email conformation Link", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
_emailSender.SendMailSendGrid(_appSettings.frommail, "", nuser.EmailId, "", "", "Socioboard Email confirmation Link", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword);
}
catch
{
Expand Down
9 changes: 5 additions & 4 deletions src/Api.Socioboard/Controllers/WebHookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public async Task<HttpResponseMessage> Post()
try
{
MongoRepository mongorepo = new MongoRepository("MongoFacebookFeed", _appSettings);

mongorepo.Add<MongoFacebookFeed>(_FacebookPagePost);
_logger.LogInformation("first feeds added " + _FacebookPagePost);
}
Expand Down Expand Up @@ -468,7 +469,7 @@ public async Task<HttpResponseMessage> Post()
_logger.LogInformation("FeedDescription" + link);

}
catch(Exception ex)
catch (Exception ex)
{
_FacebookPagePost.FeedDescription = "";
_logger.LogInformation("Exception" + ex);
Expand Down Expand Up @@ -541,7 +542,7 @@ public async Task<HttpResponseMessage> Post()
_FacebookPagePost.EntryDate = DateTime.UtcNow.ToString("yyyy/MM/dd HH:mm:ss");
}
catch { }


try
{
Expand All @@ -557,8 +558,8 @@ public async Task<HttpResponseMessage> Post()
_logger.LogError(ex.StackTrace);
}

}

}
if (x["changes"][0]["value"]["item"] == "like" || x["changes"][0]["value"]["item"] == "like")
{
string profileId = Convert.ToString(x["id"]);
Expand Down
2 changes: 2 additions & 0 deletions src/Api.Socioboard/Controllers/YoutubeGroupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public ActionResult GetYtYourGroups(Int64 userId)
}




[HttpPost("ValidateEmail")]
public ActionResult ValidateEmail(string Token)
{
Expand Down
1 change: 1 addition & 0 deletions src/Api.Socioboard/Helper/TwitterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ public static Domain.Socioboard.Models.TwitterFriendRelation TwitterFrindsRelati
tempScreenNames.Add(_objLstData.fromScreenName);
}
}
lstConveUsers.RemoveAll(t => t.fromScreenName == twtacc.twitterScreenName);
return lstConveUsers.ToList();
}
catch (Exception ex)
Expand Down
45 changes: 4 additions & 41 deletions src/Api.Socioboard/Repositories/ContentStudioRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,13 @@ public static string saveContentDataIdReposi(List<Domain.Socioboard.Models.Mongo


int totalval = 0;
// DateTime timeval = DateTime.Now;
foreach (var fbid in lstProfileIds)
{

Domain.Socioboard.Models.Facebookaccounts listfb = dbr.FindSingle<Domain.Socioboard.Models.Facebookaccounts>(t => t.FbUserId == fbid);
int countval = 0;
int countitem = 0;
string timevalue = null;
string sectimevalue = null;
foreach (var item in shareathon)
{

var retval = mongoreposhareId.Find<Domain.Socioboard.Models.Mongo.ContentStudioShareathonIdData>(t => t.FbPageId.Contains(fbid) && t.postId == item.postId);
var taskval = Task.Run(async () =>
{
Expand All @@ -313,33 +308,17 @@ public static string saveContentDataIdReposi(List<Domain.Socioboard.Models.Mongo
lstIdforPost.Timeintervalminutes = timeInterval;
lstIdforPost.postId = item.postId;
lstIdforPost.lastsharestamp = SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);
if (countitem==0)
{
lstIdforPost.latsSharetime = DateTime.UtcNow;
}
else
{
// a.AddMinutes
DateTime secval = Convert.ToDateTime(timevalue);
lstIdforPost.latsSharetime = secval.AddMinutes(timeInterval);//timevalue.latsSharetime.AddMinutes(timeInterval);
// var result = TimeSpan.FromMinutes(timeInterval);
// lstIdforPost.lastsharestamp = lstIdforPost.lastsharestamp + datetotimestamp;

}


try
{
mongoreposhareId.Add(lstIdforPost);

//countval++;
}
catch (Exception ex)
{
//return "not added";
}
DateTime timeval = lstIdforPost.latsSharetime;
timevalue =timeval.ToString();


}
int count = 0;
try
Expand Down Expand Up @@ -380,19 +359,7 @@ public static string saveContentDataIdReposi(List<Domain.Socioboard.Models.Mongo
lstforShareathon.UserId = userId;
lstforShareathon.Timeintervalminutes = timeInterval;
lstforShareathon.lastsharestamp = SBHelper.ConvertToUnixTimestamp(DateTime.UtcNow);

lstforShareathon.Status = false;
if (countitem == 0)
{
lstforShareathon.latsSharetime = DateTime.UtcNow;
}
else
{
// a.AddMinutes
DateTime sectableaddtime = Convert.ToDateTime(sectimevalue);
lstforShareathon.latsSharetime = sectableaddtime.AddMinutes(timeInterval);

}
try
{
mongorepo.Add(lstforShareathon);
Expand All @@ -402,16 +369,12 @@ public static string saveContentDataIdReposi(List<Domain.Socioboard.Models.Mongo
{
//return "not added";
}

DateTime timevalsec = lstforShareathon.latsSharetime;
sectimevalue = timevalsec.ToString();

}
else
{
// return "some problem while adding";
}
countitem++;

totalval = countval;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ public static class FacaebookPageReportsRepositories
if (task.Result != null)
{
IList<Domain.Socioboard.Models.Mongo.FacebookPagePost> lstfacebookpagepost = task.Result.ToList();
lstfacebookpagepost = lstfacebookpagepost.OrderByDescending(t => t.CreatedTime).ToList();
var facebookId = lstfacebookpagepost.GroupBy(x => x.PageId).Select(x => x.First()).ToList();
var random = new Random();
foreach (Domain.Socioboard.Models.Mongo.FacebookPagePost lstcolordata in facebookId)
Expand Down
Loading

0 comments on commit a937795

Please sign in to comment.