+
⚙️ Custom Setup:
+
+
For advanced users who want to manually configure their setup or have specific requirements.
+
Create or edit ~/.wakatime.cfg
with the following content:
-
-
🪟 Windows users:
-
- Open PowerShell: Press Windows + R , type "powershell", press Enter
- Copy the command below (click the Copy button!)
- Paste it (right-click in PowerShell, or Ctrl+V )
- Press Enter and wait for the magic!
-
-
- $env:HACKATIME_API_KEY="<%= @current_user_api_key %>"; $env:HACKATIME_API_URL="<%= api_hackatime_v1_url %>"; powershell -ExecutionPolicy Bypass -Command "& {iwr <%= root_url %>hackatime/setup.ps1 -UseBasicParsing | iex}"
- Copy
-
-
- VIDEO
-
-
-
- Using Mac/Linux/Codespaces?
- Custom Setup
-
+
+ [settings]
api_url = <%= api_hackatime_v1_url %>
api_key = <%= @current_user_api_key %>
heartbeat_rate_limit_seconds = 30
+ Copy
-
-
⚙️ Custom Setup:
-
-
For advanced users who want to manually configure their setup or have specific requirements.
-
-
Create or edit ~/.wakatime.cfg
with the following content:
-
-
- [settings]
api_url = <%= api_hackatime_v1_url %>
api_key = <%= @current_user_api_key %>
heartbeat_rate_limit_seconds = 30
- Copy
-
-
-
- Using Mac/Linux/Codespaces?
- Using Windows?
-
-
+
And install the "Wakatime" extension for all your IDEs.
@@ -111,38 +46,7 @@
diff --git a/app/views/users/wakatime_setup_step_4.html.erb b/app/views/users/wakatime_setup_step_4.html.erb
deleted file mode 100644
index 350131c5..00000000
--- a/app/views/users/wakatime_setup_step_4.html.erb
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
🎉 Setup Complete!
-
- <%= @no_instruction_wording %> You're all set!
-
-
-
-
-
-
- <%= link_to my_wakatime_setup_step_2_path, class: "bg-secondary hover:bg-darkless text-white px-6 py-3 rounded-lg font-semibold transition-colors" do %>
- Set up another editor
- <% end %>
-
- <% if (url = session.dig(:return_data, "url")) %>
- <%= link_to url, class: "bg-primary hover:bg-red text-white px-8 py-3 rounded-lg font-semibold transition-colors text-lg" do %>
- <%= session.dig(:return_data, "button_text") || "Done" %>
- <% end %>
- <% else %>
- <%= link_to root_path, class: "bg-primary hover:bg-red text-white px-8 py-3 rounded-lg font-semibold transition-colors text-lg" do %>
- Get Started
- <% end %>
- <% end %>
-
-
-
diff --git a/config/routes.rb b/config/routes.rb
index 1b72da11..ad15e429 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -114,8 +114,6 @@ def matches?(request)
get "my/wakatime_setup", to: "users#wakatime_setup"
get "my/wakatime_setup/step-2", to: "users#wakatime_setup_step_2"
- get "my/wakatime_setup/step-3", to: "users#wakatime_setup_step_3"
- get "my/wakatime_setup/step-4", to: "users#wakatime_setup_step_4"
post "/sailors_log/slack/commands", to: "slack#create"
post "/timedump/slack/commands", to: "slack#create"
diff --git a/public/hackatime/setup.ps1 b/public/hackatime/setup.ps1
deleted file mode 100644
index 6cebe480..00000000
--- a/public/hackatime/setup.ps1
+++ /dev/null
@@ -1,70 +0,0 @@
-try {
- # Create config file with API settings
- $configPath = "$env:USERPROFILE\.wakatime.cfg"
- # If config exists, backup
- if (Test-Path $configPath) {
- Write-Host "[INFO] Config file already exists, moving into ~/.wakatime.cfg.bak"
- Move-Item -Path $configPath -Destination "$configPath.bak"
- }
-
- @"
-[settings]
-api_url = $env:HACKATIME_API_URL
-api_key = $env:HACKATIME_API_KEY
-heartbeat_rate_limit_seconds = 30
-"@ | Out-File -FilePath $configPath -Force -Encoding utf8
-
- Write-Host "Config file created at $configPath"
-
- # Verify config was created successfully
- if (Test-Path $configPath) {
- $config = Get-Content $configPath
- $apiUrl = ($config | Select-String "api_url").ToString().Split('=')[1].Trim()
- $apiKey = ($config | Select-String "api_key").ToString().Split('=')[1].Trim()
- $heartbeatRate = ($config | Select-String "heartbeat_rate_limit_seconds").ToString().Split('=')[1].Trim()
-
- # Display verification info
- Write-Host "API URL: $apiUrl"
- Write-Host ("API Key: " + $apiKey.Substring(0,4) + "..." + $apiKey.Substring($apiKey.Length-4)) # Show first/last 4 chars
-
- # Send test heartbeat
- Write-Host "Sending test heartbeat..."
- $time = [Math]::Floor([decimal](Get-Date(Get-Date).ToUniversalTime()-uformat '%s'))
- $heartbeat = @{
- type = 'file'
- time = $time
- entity = 'test.txt'
- language = 'Text'
- }
-
- $response = Invoke-RestMethod -Uri "$apiUrl/users/current/heartbeats" `
- -Method Post `
- -Headers @{Authorization="Bearer $apiKey"} `
- -ContentType 'application/json' `
- -Body "[$($heartbeat | ConvertTo-Json)]"
-
- Write-Host "Test heartbeat sent successfully"
-
- # Display ASCII art on success
- Write-Host "`n" -NoNewline
- Write-Host " _ _ _ _ _ " -ForegroundColor Cyan
- Write-Host " | | | | __ _ ___| | ____ _| |_(_)_ __ ___ ___ " -ForegroundColor Cyan
- Write-Host " | |_| |/ _` |/ __| |/ / _` | __| | '_ ` _ \ / _ \" -ForegroundColor Cyan
- Write-Host " | _ | (_| | (__| < (_| | |_| | | | | | | __/" -ForegroundColor Cyan
- Write-Host " |_| |_|\__,_|\___|_|\_\__,_|\__|_|_| |_| |_|\___|" -ForegroundColor Cyan
- Write-Host "`n Ready to track! " -ForegroundColor Green
- Write-Host " https://hackatime.hackclub.com " -ForegroundColor Yellow
- Write-Host "`n"
- } else {
- throw "Failed to create config file"
- }
-} catch {
- Write-Host "----------------------------------------"
- Write-Host "ERROR: An error occurred during setup:" -ForegroundColor Red
- Write-Host $_.Exception.Message -ForegroundColor Red
- Write-Host "----------------------------------------"
-}
-finally {
- Write-Host "Press any key to exit..."
- $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
-}
diff --git a/public/hackatime/setup.sh b/public/hackatime/setup.sh
deleted file mode 100644
index 9a37edca..00000000
--- a/public/hackatime/setup.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-set -e
-
-# If config exists, backup
-if [ -f ~/.wakatime.cfg ]; then
- echo "[INFO] Config file already exists, moving into ~/.wakatime.cfg.bak"
- mv ~/.wakatime.cfg ~/.wakatime.cfg.bak
-fi
-
-# Create or update config file
-cat > ~/.wakatime.cfg << EOL
-[settings]
-api_url = ${HACKATIME_API_URL}
-api_key = ${HACKATIME_API_KEY}
-heartbeat_rate_limit_seconds = 30
-EOL
-
-echo "Config file created at ~/.wakatime.cfg"
-
-# Read values from config to verify
-if [ ! -f ~/.wakatime.cfg ]; then
- echo "Error: Config file not found"
- exit 1
-fi
-
-API_URL=$(sed -n 's/.*api_url = \(.*\)/\1/p' ~/.wakatime.cfg)
-API_KEY=$(sed -n 's/.*api_key = \(.*\)/\1/p' ~/.wakatime.cfg)
-HEARTBEAT_RATE_LIMIT=$(sed -n 's/.*heartbeat_rate_limit_seconds = \(.*\)/\1/p' ~/.wakatime.cfg)
-
-if [ -z "$API_URL" ] || [ -z "$API_KEY" ] || [ -z "$HEARTBEAT_RATE_LIMIT" ]; then
- echo "Error: Could not read api_url, api_key, or heartbeat_rate_limit_seconds from config"
- exit 1
-fi
-
-echo "Successfully read config:"
-echo "API URL: $API_URL"
-echo "API Key: ${API_KEY:0:8}..." # Show only first 8 chars for security
-
-# Send test heartbeat using values from config
-echo "Sending test heartbeat..."
-response=$(curl -s -w "\n%{http_code}" -X POST "$API_URL/users/current/heartbeats" \
- -H "Authorization: Bearer $API_KEY" \
- -H "Content-Type: application/json" \
- -d "[{\"type\":\"file\",\"time\":$(date +%s),\"entity\":\"test.txt\",\"language\":\"Text\"}]")
-
-http_code=$(echo "$response" | tail -n1)
-body=$(echo "$response" | sed '$d')
-
-if [ "$http_code" = "200" ] || [ "$http_code" = "202" ]; then
- curl "$SUCCESS_URL"
- echo -e "\nTest heartbeat sent successfully"
-else
- echo -e "\nError sending heartbeat: $body"
- exit 1
-fi