Skip to content

Commit

Permalink
added download count
Browse files Browse the repository at this point in the history
  • Loading branch information
rayenghanmi committed Dec 23, 2024
1 parent ecd2a0f commit 420fae9
Showing 1 changed file with 46 additions and 9 deletions.
55 changes: 46 additions & 9 deletions rytunex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,57 @@
<meta name="twitter:site" content="@rayen_ghanmi_23">
<meta name="twitter:creator" content="@rayen_ghanmi_23">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "RyTuneX",
"url": "https://rayenghanmi.github.io",
"logo": "https://rayenghanmi.github.io/assets/og.jpg",
"description": "Windows 10 and 11 Optimizer"
}
{
"@context": "http://schema.org",
"@type": "SoftwareApplication",
"name": "RyTuneX",
"url": "https://rayenghanmi.github.io",
"logo": "https://rayenghanmi.github.io/assets/og.jpg",
"description": "Windows 10 and 11 Optimizer",
"contactPoint": {
"@type": "ContactPoint",
"email": "ghanmirayen12@gmail.com",
"contactType": "Customer Support",
"areaServed": "Global",
"availableLanguage": "English"
},
"sameAs": [
"https://twitter.com/rayen_ghanmi_23",
"https://instagram.com/rayen.ghanmi.23",
"https://facebook.com/rayen.ghanmi.23",
]
}
</script>

<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="assets/favicon.ico" type="image/x-icon">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Exo:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<script>
async function getDownloadCount() {
try {
const response = await fetch('https://api.github.com/repos/rayenghanmi/RyTuneX/releases');
const data = await response.json();
let totalDownloadCount = 0;
data.forEach(release => {
release.assets.forEach(asset => {
totalDownloadCount += asset.download_count;
});
});
let formattedDownloadCount = totalDownloadCount;
if (totalDownloadCount >= 1000000) {
formattedDownloadCount = (totalDownloadCount / 1000000).toFixed(1) + 'M';
} else if (totalDownloadCount >= 1000) {
formattedDownloadCount = (totalDownloadCount / 1000).toFixed(1) + 'K';
}
document.getElementById('download-count').textContent = formattedDownloadCount;
} catch (error) {
console.error('Error fetching release data:', error);
}
}
window.onload = getDownloadCount;
</script>

</head>
<body>
Expand All @@ -44,6 +79,8 @@
<div class="app-name-container">
<img src="assets/logo.png" alt="Logo" class="logo">
<span class="app-name">RyTuneX</span>
<i style="margin-left: 20px;">&#xE896;</i>
<p style="margin-left: 5px;" id="download-count"></p>
</div>
<div>
<a href="#faqs" class="link">FAQs</a>
Expand Down

0 comments on commit 420fae9

Please sign in to comment.