Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some bugs. Moved more configurations to Web.Config.

  • Loading branch information...
commit 0a09373d8a54c77947c91d509f6d210657cff111 1 parent 2e46882
@keyvan authored
View
14 MiniHawraman/MiniHawraman.Core/ActionResults/RssResult.cs
@@ -22,8 +22,8 @@ public RssResult(SiteSettings siteSettings, IEnumerable<Episode> episodes)
public override void ExecuteResult(ControllerContext context)
{
- string authorName = "Keyvan Nayyeri";
- string authorEmail = "i@keyvan.fm";
+ string authorName = ConfigurationManager.AppSettings["RssAuthorName"];
+ string authorEmail = ConfigurationManager.AppSettings["RssAuthorEmail"];
context.HttpContext.Response.ContentType = "application/rss+xml";
@@ -70,12 +70,6 @@ public override void ExecuteResult(ControllerContext context)
// End image
writer.WriteEndElement();
- // Categories
- writer.WriteElementString("Category", "Technology");
- writer.WriteElementString("Category", "Software Development");
- writer.WriteElementString("Category", "Podcast");
- writer.WriteElementString("Category", "Talk");
-
writer.WriteElementString("author", itunesUri, authorName);
writer.WriteElementString("subtitle", itunesUri, this._siteSettings.Description);
@@ -104,11 +98,11 @@ public override void ExecuteResult(ControllerContext context)
// First category
// Start itunes:category
writer.WriteStartElement("category", itunesUri);
- writer.WriteAttributeString("text", "Technology");
+ writer.WriteAttributeString("text", ConfigurationManager.AppSettings["iTunesCategory"]);
// Start itunes:category
writer.WriteStartElement("category", itunesUri);
- writer.WriteAttributeString("text", "Software How-To");
+ writer.WriteAttributeString("text", ConfigurationManager.AppSettings["iTunesSubCategory"]);
// End itunes:category
writer.WriteEndElement();
View
1  MiniHawraman/MiniHawraman.Core/Controllers/BaseController.cs
@@ -11,6 +11,7 @@ public BaseController(ISiteService blogService)
{
this._siteService = blogService;
+ ViewBag.SiteTitle = this._siteService.Title;
ViewBag.PageTitle = this._siteService.Title;
ViewBag.SiteDescription = this._siteService.Description;
ViewBag.SiteFeed = this._siteService.Feed;
View
5 MiniHawraman/MiniHawraman.Core/Controllers/SubscriptionController.cs
@@ -43,5 +43,10 @@ public ActionResult Facebook()
{
return new RedirectResult(ConfigurationManager.AppSettings["FacebookUrl"], false);
}
+
+ public ActionResult Twitter()
+ {
+ return new RedirectResult(ConfigurationManager.AppSettings["TwitterUrl"], false);
+ }
}
}
View
6 MiniHawraman/MiniHawraman.Core/HawramanApplication.cs
@@ -138,6 +138,12 @@ private static void RegisterPublicRoutes(RouteCollection routes)
);
routes.MapRoute(
+ "Twitter",
+ "twitter/",
+ new { controller = "Subscription", action = "Twitter" }
+ );
+
+ routes.MapRoute(
"Search",
"search/{query}",
new { controller = "Search", action = "Index", query = "" }
View
2  MiniHawraman/MiniHawraman.Core/Services/Implementations/SiteService.cs
@@ -29,7 +29,7 @@ public string Feed
{
get
{
- return string.Format("{0}feed", ConfigurationManager.AppSettings["DomainName"]);
+ return string.Format("{0}rss", ConfigurationManager.AppSettings["DomainName"]);
}
}
View
3  MiniHawraman/MiniHawraman.Web/Global.asax
@@ -1 +1,2 @@
-<%@ Application Codebehind="Global.asax.cs" Inherits="Hawraman.Core.HawramanApplication" Language="C#" %>
+<%@ Application CodeBehind="Global.asax.cs" Inherits="MiniHawraman.Core.HawramanApplication"
+ Language="C#" %>
View
4 MiniHawraman/MiniHawraman.Web/Views/Shared/_Header.cshtml
@@ -3,7 +3,7 @@
<h1>
<a href="/">
<div>
- Keyvan.FM</div>
+ @ViewBag.SiteTitle</div>
</a>
</h1>
<nav id="mainNav">
@@ -11,7 +11,7 @@
<li><a href="/rss">RSS</a></li>
<li><a href="/itunes">iTunes</a></li>
<li><a href="/zune">Zune</a></li>
- <li><a href="http://twitter.com/keyvanfm">Twitter</a></li>
+ <li><a href="/twitter">Twitter</a></li>
<li><a href="/facebook">Facebook</a></li>
</nav>
</div>
View
45 MiniHawraman/MiniHawraman.Web/Views/Shared/_Layout.cshtml
@@ -5,35 +5,34 @@
Design: The Minimalist (http://minimalist.co)
-->
+@using System.Configuration;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>@ViewBag.PageTitle</title>
<meta name="description" content="@ViewBag.SiteDescription" />
- <meta name="generator" content="Mini Hawraman Version 1.0.0.0" />
- <meta name="keywords" content="Keyvan Nayyeri, Podcast, Audio, Programming, Software Development, Computer Science, Technology" />
+ <meta name="generator" content="Mini Hawraman" />
<link rel="stylesheet" href="/content/css/styles.css" />
- <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://keyvan.fm/rss" />
-
- @using System.Configuration;
- @{
- var facebookPageId = ConfigurationManager.AppSettings["FacebookPageId"];
- var domainName = ConfigurationManager.AppSettings["DomainName"];
- var siteName = ConfigurationManager.AppSettings["OpenGraphSiteName"];
- }
-
- @RenderSection("head", required: false);
-@if (!IsSectionDefined("head")){
- <meta property="og:title" content="@ViewBag.PageTitle" />
- <meta property="og:type" content="website" />
- <meta property="og:url" content="@Request.Url" />
-}
- @if (!String.IsNullOrWhiteSpace(facebookPageId)) { <meta property="fb:page_id" content="@facebookPageId" /> }
- <meta property="og:locale" content="en_US" />
- <meta property="og:site_name" content="@siteName" />
- <meta property="og:image" content="@domainName/content/images/logo.jpg" />
- <meta property="og:image:type" content="image/jpeg" />
-
+ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="@ViewBag.SiteFeed" />
+ @{
+ string facebookPageId = ConfigurationManager.AppSettings["FacebookPageId"];
+ string domainName = ConfigurationManager.AppSettings["DomainName"];
+ }
+ @RenderSection("head", required: false);
+ @if (!IsSectionDefined("head"))
+ {
+ <meta property="og:title" content="@ViewBag.PageTitle" />
+ <meta property="og:type" content="website" />
+ <meta property="og:url" content="@Request.Url" />
+ }
+ @if (!String.IsNullOrWhiteSpace(facebookPageId))
+ {
+ <meta property="fb:page_id" content="@facebookPageId" />
+ }
+ <meta property="og:locale" content="en_US" />
+ <meta property="og:site_name" content="@ViewBag.SiteTitle" />
+ <meta property="og:image" content="@domainName + 'content/images/logo.jpg'" />
+ <meta property="og:image:type" content="image/jpeg" />
</head>
@RenderBody()
</html>
View
11 MiniHawraman/MiniHawraman.Web/Web.config
@@ -9,15 +9,20 @@
<add key="TwilioAuthToken" value="[TwilioAuthToken]"/>
<add key="TwilioSenderPhone" value="[TwilioSenderPhone]"/>
<add key="TwilioReceiverPhone" value="[TwilioReceiverPhone]"/>
- <add key="iTunesSubscriptionUrl" value="http://itunes.apple.com/us/podcast/keyvan.fm/id510238929"/>
- <add key="ZuneSubscriptionUrl" value="http://social.zune.net/podcast/Keyvan.TV/e16452bd-2224-4ae8-acd0-3027543a66fc"/>
- <add key="FacebookUrl" value="https://www.facebook.com/keyvan.fm"/>
+ <add key="iTunesSubscriptionUrl" value="[iTunesSubscriptionUrl]"/>
+ <add key="ZuneSubscriptionUrl" value="[ZuneSubscriptionUrl]"/>
+ <add key="FacebookUrl" value="[FacebookUrl]"/>
+ <add key="TwitterUrl" value="[TwitterUrl]"/>
<add key="FacebookPageId" value="[FacebookPageId]"/>
<add key="OpenGraphSiteName" value="[SiteName]" />
<add key="OpenGraphPodcastName" value="[PodcastName]" />
<add key="EmailSmtp" value="smtp.gmail.com"/>
<add key="EmailUsername" value="username@gmail.com"/>
<add key="EmailPassword" value="pas$word"/>
+ <add key="RssAuthorName" value="[RssAuthorName]"/>
+ <add key="RssAuthorEmail" value="[RssAuthorEmail]"/>
+ <add key="iTunesCategory" value="[iTunesCategory]"/>
+ <add key="iTunesSubCategory" value="[iTunesSubCategory]"/>
</appSettings>
<connectionStrings>
<add name="RavenDB" connectionString="Url=[RavenDBUrl]"/>
Please sign in to comment.
Something went wrong with that request. Please try again.