<commit_before>﻿using SteamWebAPI2.Exceptions;
using SteamWebAPI2.Models;
using System;
using System.Web.Mvc;
using WhatsMySteamId.Models;

namespace WhatsMySteamId.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View(new HomeIndexViewModel());
        }

        [HttpPost]
        public ActionResult Index(HomeIndexViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    SteamId steamId = new SteamId(model.SearchString, "639AA081215E275484A5DFB24FAF193C");

                    ulong steamId64 = steamId.To64Bit();

                    model.AccountId = steamId.AccountId;
                    model.AccountType = steamId.AccountType.ToString();
                    model.Instance = steamId.InstanceId.ToString();
                    model.CommunityProfileUrl = String.Format("http://steamcommunity.com/profiles/{0}", steamId64);
                    model.LegacySteamId = steamId.ToLegacyFormat();
                    model.ModernSteamId = steamId.ToModernFormat();
                    model.SteamId64 = steamId64;
                    model.Universe = steamId.Universe.ToString();
                    model.IsValidSteamAccount = true;
                    model.ResolvedBy = steamId.ResolvedFrom.ToString();
                }
                catch (VanityUrlNotResolvedException)
                {
                    ModelState.AddModelError("e", "Could not find any Steam Account for your entered value.");
                }
                catch (InvalidSteamCommunityUriException)
                {<commit_msg>Remove Steam Web API key. Revoke its access in Steam.<commit_after>﻿using SteamWebAPI2.Exceptions;
using SteamWebAPI2.Models;
using System;
using System.Web.Mvc;
using WhatsMySteamId.Models;

namespace WhatsMySteamId.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View(new HomeIndexViewModel());
        }

        [HttpPost]
        public ActionResult Index(HomeIndexViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    SteamId steamId = new SteamId(model.SearchString, "");

                    ulong steamId64 = steamId.To64Bit();

                    model.AccountId = steamId.AccountId;
                    model.AccountType = steamId.AccountType.ToString();
                    model.Instance = steamId.InstanceId.ToString();
                    model.CommunityProfileUrl = String.Format("http://steamcommunity.com/profiles/{0}", steamId64);
                    model.LegacySteamId = steamId.ToLegacyFormat();
                    model.ModernSteamId = steamId.ToModernFormat();
                    model.SteamId64 = steamId64;
                    model.Universe = steamId.Universe.ToString();
                    model.IsValidSteamAccount = true;
                    model.ResolvedBy = steamId.ResolvedFrom.ToString();
                }
                catch (VanityUrlNotResolvedException)
                {
                    ModelState.AddModelError("e", "Could not find any Steam Account for your entered value.");
                }
                catch (InvalidSteamCommunityUriException)
                {
{'fraction_non_alphanumeric': 0.08166862514688601, 'fraction_numerical': 0.013807285546415981, 'mean_word_length': 1.6684952978056427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1074383', 'n_tokens_mistral': 908, 'n_tokens_neox': 824, 'n_words': 160}