Add updater

This commit is contained in:
Norbi Peti 2019-05-23 23:27:46 +02:00
parent c3b33ea561
commit 6ab4e1ed52
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
33 changed files with 183 additions and 325 deletions

View file

@ -1,22 +0,0 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[{.travis.yml,package.json}]
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space

28
.gitattributes vendored
View file

@ -1,28 +0,0 @@
# Automatically normalize line endings for all text-based files
# https://git-scm.com/docs/gitattributes#_end_of_line_conversion
* text=auto
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.xml text eol=lf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Exclude the `.htaccess` file from GitHub's language statistics
# https://github.com/github/linguist#using-gitattributes
dist/.htaccess linguist-vendored

0
.gitignore vendored
View file

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jquery-3.3.1" level="application" />
</component>
</module>

View file

@ -1,15 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
</JSCodeStyleSettings>
<codeStyleSettings language="JavaScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View file

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{jquery-3.3.1}" />
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HS.iml" filepath="$PROJECT_DIR$/.idea/HS.iml" />
</modules>
</component>
</project>

View file

@ -1,4 +0,0 @@
---
---
<h1 style="text-align: center">Page Not Found</h1>
<p style="text-align: center">Sorry, but the page you were trying to view does not exist.</p>

BIN
HS.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 MiB

16
HS.sln Normal file
View file

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HiddenUpdater", "HiddenUpdater\HiddenUpdater.csproj", "{74B49E86-F983-4818-8A53-F4C6F69777E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74B49E86-F983-4818-8A53-F4C6F69777E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74B49E86-F983-4818-8A53-F4C6F69777E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74B49E86-F983-4818-8A53-F4C6F69777E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74B49E86-F983-4818-8A53-F4C6F69777E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View file

@ -1,19 +0,0 @@
Copyright (c) HTML5 Boilerplate
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{74B49E86-F983-4818-8A53-F4C6F69777E2}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HiddenUpdater</RootNamespace>
<AssemblyName>HiddenUpdater</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SpotifyAPI.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\SpotifyAPI.Web.4.1.0\lib\net46\SpotifyAPI.Web.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SpotifyAPI.Web.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\SpotifyAPI.Web.Auth.4.1.0\lib\net46\SpotifyAPI.Web.Auth.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Unosquare.Labs.EmbedIO, Version=2.2.7.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EmbedIO.2.2.7\lib\net472\Unosquare.Labs.EmbedIO.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Unosquare.Swan.Lite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Unosquare.Swan.Lite.0.38.1\lib\net452\Unosquare.Swan.Lite.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="secret.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

43
HiddenUpdater/Program.cs Normal file
View file

@ -0,0 +1,43 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SpotifyAPI.Web;
using SpotifyAPI.Web.Auth;
namespace HiddenUpdater
{
internal class Program
{
private const string PlaylistId = "2YDWLcBzTpDNQDfcQyy76b";
public static async Task Main(string[] args)
{
var auth = new CredentialsAuth("ce11c54b88cf41149e528de5ec73aa69", File.ReadAllText("secret.txt"));
var token = await auth.GetToken();
var spotify = new SpotifyWebAPI
{
AccessToken = token.AccessToken,
TokenType = token.TokenType
};
var playlist = spotify.GetPlaylist(PlaylistId);
Console.WriteLine(playlist);
var playlistJson = new JArray();
var tracks = playlist.Tracks;
Console.WriteLine("Total: " + tracks.Total);
int C = 0;
for (int i = 0; i < tracks.Total; i+=100)
{
if (i > 0)
tracks = spotify.GetPlaylistTracks(PlaylistId, offset: i);
foreach (var track in tracks.Items)
{
Console.WriteLine("Track: "+track.Track.Name);
C++;
}
}
Console.WriteLine(C + " / " + tracks.Total);
}
}
}

View file

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HiddenUpdater")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HiddenUpdater")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("74B49E86-F983-4818-8A53-F4C6F69777E2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EmbedIO" version="2.2.7" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="SpotifyAPI.Web" version="4.1.0" targetFramework="net472" />
<package id="SpotifyAPI.Web.Auth" version="4.1.0" targetFramework="net472" />
<package id="Unosquare.Swan.Lite" version="0.38.1" targetFramework="net472" />
</packages>

View file

@ -1,2 +0,0 @@
# HiddenSounds
Fan site for Hidden Sounds

View file

@ -1,5 +0,0 @@
---
name: Artist1
position: Singer
---
Test artist

View file

@ -1,6 +0,0 @@
---
short_name: test
name: Test
position: Producer
---
Test artist

View file

@ -1,16 +0,0 @@
collections:
artists:
output: true
defaults:
- scope:
path: ""
type: "artists"
values:
layout: "artist"
- scope:
path: ""
values:
layout: "default"
baseurl: /HiddenSounds

View file

@ -1,12 +0,0 @@
[
{
"artist": "Artist1",
"title": "Title1",
"url": "https://spotify.com/"
},
{
"artist": "Artist2",
"title": "Title2",
"url": "https://spotify.com/"
}
]

View file

@ -1,16 +0,0 @@
---
layout: default
title: page.name
---
<h1>{{ page.name }}</h1>
<h2>{{ page.position }}</h2>
{{ content }}
<h2>Songs</h2>
<ul>
{% assign filtered_songs = site.data.songs | where: 'artist', page.name %}
{% for song in filtered_songs %}
<li><a href="{{ song.url }}">{{ song.artist }} - {{ song.title }}</a></li>
{% endfor %}
</ul>

View file

@ -1,27 +0,0 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>{{ page.title }} - HS Fanpage</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
<meta name="theme-color" content="#fafafa">
</head>
<body>
<div class="bg-image"></div>
<!--[if IE]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
{{ content }}
</body>
</html>

View file

@ -1,14 +0,0 @@
---
title: Artists
---
<h1>Artists</h1>
<ul>
{% for artist in site.artists %}
<li>
<h2>{{ artist.name }}</h2>
<h3>{{ artist.position }}</h3>
<p>{{ artist.content | markdownify }}</p>
</li>
{% endfor %}
</ul>

BIN
bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 MiB

View file

@ -1,44 +0,0 @@
body {
background-color: #003239;
color: aqua;
}
.bg-image {
/*background-image: url("../HS.png");*/
background-image: url("../bg.png"), linear-gradient(to bottom, #1d1d1d, #1d1d1d, #243537, #009a9a);
/*#727272);*/
background-size: cover;
filter: blur(16px);
height: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: -1;
margin: 0;
padding: 0;
}
#popularSongs, #hiddenSongs {
width: 40%;
margin: 4%;
border: 1px #78ffee solid;
}
#popularSongs h2, #hiddenSongs h2 {
text-align: center;
color: aqua;
}
#popularSongs {
float: left;
}
#hiddenSongs {
float: right;
}
h1 {
text-align: center;
}

View file

@ -1,15 +0,0 @@
# humanstxt.org/
# The humans responsible & technology colophon
# TEAM
<name> -- <role> -- <twitter>
# THANKS
<name>
# TECHNOLOGY COLOPHON
CSS3, HTML5
Apache Server Configs, jQuery, Modernizr, Normalize.css

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -1,33 +0,0 @@
---
layout: default
title: Hidden Sounds
---
<h1>Hidden Sounds Unofficial (Fan) Website</h1>
<div id="popularSongs">
<h2>Popular Songs</h2>
<div id="popularContainer">
{% for song in site.data.songs %}
<div class="song">
<p>
{% assign artist = site.artists | where: 'name', song.artist | first %}
{% if artist %}
<a href="{{ artist.url | prepend: site.baseurl }}">{{ artist.name }}</a>
{% else %}
{{ song.artist }}
{% endif %}
- <a href="https://spotify.com/">{{ song.title }}</a>
</p>
</div>
{% endfor %}
</div>
</div>
<div id="hiddenSongs">
<h2>Hidden Songs</h2>
<div id="hiddenContainer">
{% for song in site.data.songs %}
<div class="song">
<p><a href="https://spotify.com/">Artist - Title</a></p>
</div>
{% endfor %}
</div>
</div>

View file

@ -1,5 +0,0 @@
# www.robotstxt.org/
# Allow crawling of all content
User-agent: *
Disallow: