Skip to content

Commit

Permalink
Socioboard 3.0
Browse files Browse the repository at this point in the history
Github commit
--------------
*facebook login bugs fixed.
*made changes in content studio module.
*pinterest feed issue.
*fixed logout issue.
*fixed discovery issue
  • Loading branch information
socioboard committed Oct 9, 2017
1 parent 99305bb commit 6a2ffbd
Show file tree
Hide file tree
Showing 148 changed files with 623 additions and 273 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
88 changes: 44 additions & 44 deletions src/Api.Socioboard/Controllers/AdvanceSearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,52 @@ public AdvanceSearchController(ILogger<AdvanceSearchController> logger, Microsof



[HttpGet("GetYTAdvanceSearchData")]
public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 100)
{
return Ok(Repositories.ContentStudioRepository.YuTubeAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.networkType.Equals(network), sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
return Ok(lstTwitterFeeds);
}
}
//[HttpGet("GetYTAdvanceSearchData")]
//public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
//{
// DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
// MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
// if (skip + count < 100)
// {
// return Ok(Repositories.ContentStudioRepository.YuTubeAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
// }
// else
// {
// var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
// var sort = builder.Descending(t => t.totalShareCount);
// var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.networkType.Equals(network), sort, skip, count);
// var task = Task.Run(async () =>
// {
// return await result;
// });
// IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
// return Ok(lstTwitterFeeds);
// }
//}


[HttpGet("GetSortByData")]
public IActionResult GetSortByData(string sortType, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 200)
{
return Ok(Repositories.ContentStudioRepository.GetSortBy(sortType, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
return Ok(lstTwitterFeeds);
}
}
//[HttpGet("GetSortByData")]
//public IActionResult GetSortByData(string sortType, int skip, int count)
//{
// DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
// MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
// if (skip + count < 200)
// {
// return Ok(Repositories.ContentStudioRepository.GetSortBy(sortType, _redisCache, _appSettings).Skip(skip).Take(count));
// }
// else
// {
// var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
// var sort = builder.Descending(t => t.totalShareCount);
// var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count);
// var task = Task.Run(async () =>
// {
// return await result;
// });
// IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
// return Ok(lstTwitterFeeds);
// }
//}


[HttpGet("QuickTopics")]
Expand Down
69 changes: 36 additions & 33 deletions src/Api.Socioboard/Controllers/BoardMeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task<IActionResult> createBoard(string boardName, string fbHashTag,
{
Repositories.BoardMeRepository.BoardMeRepository brRepository = new Repositories.BoardMeRepository.BoardMeRepository();
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
AddTOSiteMap(boardName);
// AddTOSiteMap(boardName);
return Ok(await brRepository.CreateBoard(boardName, twitterHashTag, instagramHashTag, gplusHashTag, userId, _redisCache, _appSettings, _logger, dbr));
}

Expand Down Expand Up @@ -173,7 +173,7 @@ public IActionResult getBoardByName(string boardName)
[HttpGet("getBoardFeedsByName")]
public IActionResult getBoardFeedsByName(string boardName)
{
//boardName = boardName.Replace("SB", "/");
boardName = boardName.Replace("SB", "/");
try
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
Expand Down Expand Up @@ -517,27 +517,7 @@ public IActionResult AddTOSiteMap(string boardName)
try
{
string appendNode = "<url><loc>https://boards.socioboard.com/" + boardName + "</loc><lastmod>" + DateTime.UtcNow.ToString("yyyy-MM-dd") + "</lastmod><changefreq>Hourly</changefreq><priority>0.6</priority></url>";
//XmlTextWriter writer = new XmlTextWriter("site.xml", System.Text.Encoding.UTF8);
//writer.WriteStartDocument();
//writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");

//writer.WriteStartElement("url");

//writer.WriteElementString("loc", boardName);
//writer.WriteElementString("priority", "0.5");
//writer.WriteEndElement();

////Now we loop for creating the XML node for all products

//int i = 0;
////Creating the element
//writer.WriteStartElement("url");
//writer.WriteElementString("loc", "teste");
//writer.WriteElementString("priority", "0.5");
//writer.WriteEndElement();
//writer.WriteEndDocument();
//writer.Close();
XmlDocument doc = new XmlDocument();
XmlDocument doc = new XmlDocument();
doc.Load(_appSettings.sitemapPath);
var abc = doc.DocumentElement.GetElementsByTagName("url");
if (abc.Count >=500)
Expand All @@ -548,16 +528,6 @@ public IActionResult AddTOSiteMap(string boardName)
if (Files.Count()>0)
{
XmlTextWriter writer = new XmlTextWriter(_appSettings.sitemapPath.Replace("sitemap", "sitemap" + Files.Count().ToString()), System.Text.Encoding.UTF8);
//writer.WriteStartDocument();
//writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");
//int i = 0;
//writer.WriteStartElement("url");
//writer.WriteElementString("loc", "https://boards.socioboard.com/" + boardName);
//writer.WriteElementString("priority", "0.6");
//writer.WriteElementString("changefreq", "Hourly");
//writer.WriteElementString("lastmod", DateTime.UtcNow.ToString("yyyy-MM-dd"));
//writer.WriteEndElement();
//writer.WriteEndDocument();
writer.Close();
XmlTextWriter writer1 = new XmlTextWriter(_appSettings.sitemapPath, System.Text.Encoding.UTF8);
writer1.WriteStartDocument();
Expand All @@ -571,6 +541,39 @@ public IActionResult AddTOSiteMap(string boardName)
writer1.WriteEndDocument();
writer1.Close();
doc.Save(_appSettings.sitemapPath.Replace("sitemap", "sitemap" + Files.Count().ToString()));

int length1 = d.GetFiles("*.xml").Length;
int filelength = length1 - 1;
string location = "https://boards.socioboard.com/contents/socioboard/boardSitemap/sitemap" + filelength+".xml";
string lastmode = DateTime.UtcNow.ToString("yyyy-MM-dd");
string priority = "0.6";

XmlDocument xdoc1 = new XmlDocument();
xdoc1.Load(_appSettings.sitemapPathIndex);
XmlNode url = xdoc1.CreateElement("Url");
XmlNode loc = xdoc1.CreateElement("loc");
url.InnerText = location;
url.AppendChild(loc);

XmlNode lastmod = xdoc1.CreateElement("lastmod");
lastmod.InnerText = lastmode;
url.AppendChild(lastmod);

XmlNode prioritys = xdoc1.CreateElement("priority");
prioritys.InnerText = priority;
url.AppendChild(prioritys);

xdoc1.DocumentElement.AppendChild(url);
xdoc1.Save(_appSettings.sitemapPathIndex);


//XmlDocument docIndex = new XmlDocument();
//docIndex.Load(_appSettings.sitemapPathIndex);
//docIndex.LoadXml(appendNodeIndex);
//XmlNode newNodeIndex = docIndex.DocumentElement;
//var attributename = newNodeIndex.Attributes;
//docIndex.DocumentElement.AppendChild(docIndex.ImportNode(newNodeIndex, true));
//docIndex.Save(_appSettings.sitemapPathIndex);
}
else
{
Expand Down
29 changes: 26 additions & 3 deletions src/Api.Socioboard/Controllers/ContentStudioController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public IActionResult GetAdvanceSearchData(string keywords)
return Ok(Repositories.ContentStudioRepository.GetAdvanceSearchdata(keywords, _redisCache, _appSettings));
}

[HttpGet("GetYTAdvanceSearchData")]
public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
[HttpGet("GetAdvanceSearchDataTrending")]
public IActionResult GetAdvanceSearchDataTrending(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
skip = 0;
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 100)
{
return Ok(Repositories.ContentStudioRepository.YuTubeAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
return Ok(Repositories.ContentStudioRepository.AdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
Expand All @@ -66,6 +66,29 @@ public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType n
}
}

[HttpGet("GetYTAdvanceSearchData")]
public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
skip = 0;
MongoRepository mongorepo = new MongoRepository("AdvanceSearchYoutubeContentStdData", _appSettings);
if (skip + count < 100)
{
return Ok(Repositories.ContentStudioRepository.YtAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSearchYoutubeContentStdData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSearchYoutubeContentStdData>(t => t.networkType.Equals(network), sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSearchYoutubeContentStdData> lstYoutbe = task.Result;
return Ok(lstYoutbe);
}
}

[HttpGet("GetSortByData")]
public IActionResult GetSortByData(string sortType, int skip, int count)
Expand Down
10 changes: 7 additions & 3 deletions src/Api.Socioboard/Controllers/NotificationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,21 @@ public IActionResult FindNotifications(long userId)
}

[HttpGet("FindAllNotifications")]
public IActionResult FindAllNotifications(long userId)
public IActionResult FindAllNotifications(long userId, int skip, int count)
{
try
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
List<ScheduledMessage> lstschedulemsg = new List<ScheduledMessage>();
List<Notifications> lstnotifications = dbr.Find<Notifications>(t => t.UserId == userId).ToList();
List<Notifications> lstnotifications = dbr.FindWithRange<Notifications>(t => t.UserId == userId, skip, count).ToList();
foreach (Notifications notify in lstnotifications)
{
ScheduledMessage schedulemsg = dbr.Single<ScheduledMessage>(t => t.id == notify.MsgId && t.userId==userId);
lstschedulemsg.Add(schedulemsg);
if(schedulemsg !=null)
{
lstschedulemsg.Add(schedulemsg);
}

}
if (lstschedulemsg != null)
{
Expand Down
Loading

0 comments on commit 6a2ffbd

Please sign in to comment.