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 Dec 18, 2017
1 parent 809d870 commit c117c83
Show file tree
Hide file tree
Showing 112 changed files with 1,110 additions and 424 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
22 changes: 22 additions & 0 deletions src/Api.Socioboard/Controllers/InstagramController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ public IActionResult GetInstagramFeeds(long userId,string instagramId, int skip,
}


[HttpGet("GetInstaUserdetails")]
public IActionResult GetInstaUserdetails(long userId, string instagramid)
{

DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
IList<Domain.Socioboard.Models.Instagramaccounts> Userdata = dbr.Find<Domain.Socioboard.Models.Instagramaccounts>(t => t.InstagramId==(instagramid));


return Ok(Userdata);
}

[HttpGet("GetInstagramFilterFeeds")]
public IActionResult GetInstagramFilterFeeds(long userId, string instagramId, int skip, int count, string postType)
{
Expand Down Expand Up @@ -204,5 +215,16 @@ public IActionResult AddInstagramComment(string FeedId, string Text, string Inst
string commentData = Repositories.InstagramRepository.AddInstagramComment(FeedId, Text, InstagramId, groupId, _appSettings, _redisCache, dbr);
return Ok(commentData);
}

[HttpGet("DeleteinstagramFeed")]

public IActionResult DeleteinstagramFeed(string profileId, string FeedId)
{
MongoRepository _DeleteistagramFeeds = new MongoRepository("InstagramFeed", _appSettings);
var builders = Builders<Domain.Socioboard.Models.Mongo.InstagramFeed>.Filter;
FilterDefinition<Domain.Socioboard.Models.Mongo.InstagramFeed> filter = builders.Eq("FeedId", FeedId);
_DeleteistagramFeeds.Delete<Domain.Socioboard.Models.Mongo.InstagramFeed>(filter);
return Ok();
}
}
}
188 changes: 123 additions & 65 deletions src/Api.Socioboard/Controllers/SocialMessagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,104 +146,123 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId
{
temp_item_profileId = item;
}

if (temp_item_profileId.StartsWith("fb"))
string updatedtext = "";
string postmessage = "";
string url = "";
if (!string.IsNullOrEmpty(tempmsg))
{
string updatedtext = "";
string postmessage = "";
string url = "";
if (!string.IsNullOrEmpty(tempmsg))
string[] updatedmessgae = Regex.Split(tempmsg, "<br>");
foreach (var items in updatedmessgae)
{
string[] updatedmessgae = Regex.Split(tempmsg, "<br>");
foreach (var items in updatedmessgae)
if (!string.IsNullOrEmpty(items))
{
if (!string.IsNullOrEmpty(items))
if (items.Contains("https://") || items.Contains("http://"))
{
if (items.Contains("https://") || items.Contains("http://"))
if (string.IsNullOrEmpty(url))
{
if (string.IsNullOrEmpty(url))
url = items;
if (items.Contains("https://"))
{
url = items;
if (items.Contains("https://"))
string links = Utility.getBetween(url + "###", "https", "###");
links = "https" + links;
try
{
string links = Utility.getBetween(url + "###", "https", "###");
links = "https" + links;
try
{
url = links.Split(' ')[0].ToString();
link = url;
}
catch (Exception)
{
url = links;
link = url;
}
url = links.Split(' ')[0].ToString();
link = url;
}
if (items.Contains("http://"))
catch (Exception)
{
string links = Utility.getBetween(url + "###", "http", "###");
links = "http" + links;
try
{
url = links.Split(' ')[0].ToString();
link = url;
}
catch (Exception)
{
url = links;
link = url;
}
url = links;
link = url;
}
}
if (items.Contains("http://"))
{
string links = Utility.getBetween(url + "###", "http", "###");
links = "http" + links;
try
{
url = links.Split(' ')[0].ToString();
link = url;
}
catch (Exception)
{
url = links;
link = url;
}

}

}
if (items.Contains("hhh") || items.Contains("nnn"))

}
if (items.Contains("hhh") || items.Contains("nnn"))
{
if (items.Contains("hhh"))
{
if (items.Contains("hhh"))
{
postmessage = postmessage + "\n\r" + items.Replace("hhh", "#");
}
else
{
postmessage = postmessage + "\n\r" + items;
}
postmessage = postmessage + "\n\r" + items.Replace("hhh", "#");
}
else
{
postmessage = postmessage + "\n\r" + items;
}
}

else
{
postmessage = postmessage + "\n\r" + items;
}
}

}
try
}
try
{
if (!string.IsNullOrEmpty(url))
{
if (!string.IsNullOrEmpty(url))
{
// link = url;
//updatedtext = postmessage.Replace(url, "");
updatedtext = postmessage;
// link = url;
//updatedtext = postmessage.Replace(url, "");
updatedtext = postmessage;

}
else
{
updatedtext = postmessage;
}

}
else
{
updatedtext = postmessage;
}

}
catch (Exception ex)
{

}

if (temp_item_profileId.StartsWith("fb"))
{
try
{
new Thread(delegate ()
{
string prId = temp_item_profileId.Substring(3, temp_item_profileId.Length - 3);
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();
}
catch (Exception ex)
{

}
}


else if (temp_item_profileId.StartsWith("urlfb"))
{
try
{
new Thread(delegate ()
{
string prId = temp_item_profileId.Substring(3, temp_item_profileId.Length - 3);
string prId = temp_item_profileId.Substring(6, temp_item_profileId.Length - 6);
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);
string ret = Helper.FacebookHelper.UrlComposeMessage(objFacebookAccount.FbProfileType, objFacebookAccount.AccessToken, objFacebookAccount.FbUserId, updatedtext, prId, userId, uploads, link, mediaType, objFacebookAccount.FbUserName, dbr, _logger);

}).Start();
}
Expand All @@ -254,7 +273,8 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId
}


if (temp_item_profileId.StartsWith("tw"))

else if (temp_item_profileId.StartsWith("tw"))
{
try
{
Expand All @@ -271,7 +291,8 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId

}
}
if (temp_item_profileId.StartsWith("lin"))

else if (temp_item_profileId.StartsWith("lin"))
{
try
{
Expand All @@ -287,7 +308,9 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId

}
}
if (temp_item_profileId.StartsWith("Cmpylinpage"))


else if (temp_item_profileId.StartsWith("Cmpylinpage"))
{
try
{
Expand All @@ -303,6 +326,7 @@ public async Task<IActionResult> ComposeMessage(string message, string profileId

}
}

}

return Ok("Posted");
Expand Down Expand Up @@ -471,6 +495,40 @@ public async Task<ActionResult> ScheduleMessage(string message, string profileId
// return Ok("Issue With Facebook Page schedulers");
}
}
if (item.StartsWith("urlfb"))
{
try
{
string linkurl = message;
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);
}
catch (System.Exception ex)
{
_logger.LogError(ex.StackTrace);
//return Ok("Issue With Facebook schedulers");
}
}

if (item.StartsWith("urlpage"))
{
try
{
string linkurl = message;
link = linkurl;
string prId = item.Substring(8, item.Length - 8);
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);
}
catch (System.Exception ex)
{
_logger.LogError(ex.StackTrace);
//return Ok("Issue With Facebook schedulers");
}
}

if (item.StartsWith("tw"))
{
try
Expand Down
11 changes: 11 additions & 0 deletions src/Api.Socioboard/Controllers/TwitterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,5 +465,16 @@ public IActionResult TwitterConversation(string profileId)
return Ok(lstConveSugg);
}

[HttpGet("DeleteTwtFeed")]

public IActionResult deleteTwtFeed(string profileId ,string messageId)
{
MongoRepository _DeleteTwtFeeds = new MongoRepository("MongoTwitterFeed", _appSettings);
var builders = Builders<Domain.Socioboard.Models.Mongo.MongoTwitterFeed>.Filter;
FilterDefinition<Domain.Socioboard.Models.Mongo.MongoTwitterFeed> filter = builders.Eq("messageId", messageId);
_DeleteTwtFeeds.Delete<Domain.Socioboard.Models.Mongo.MongoTwitterFeed>(filter);
return Ok();
}

}
}
Loading

0 comments on commit c117c83

Please sign in to comment.