Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 63 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
*windows/[Bb]in
*windows/[Bb]in/[Dd]ebug*/
*windows/obj/
*windows/[Bb]in/[Rr]elease*/
# Build artifacts
**/[Bb]in/
**/[Oo]bj/
**/[Dd]ebug/
**/[Rr]elease/

# Visual Studio files
.vs/
*.user
*.suo
*.userosscache
*.sln.docstates

# Build results
[Dd]ebugPublic/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# NuGet Packages
*.nupkg
**/packages/*
!**/packages/build/

# Test results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# Mac files
.DS_Store
*.xcuserstate
xcuserdata/

# Installer logs
*.cab
*.msi
*.msm
*.msp

# Windows image file caches
Thumbs.db
ehthumbs.db

# Application specific
*.log
*.exe
*.dll
*.pdb
*.application
*.manifest
!ClickOnce*/

# Updater binaries
**/Updater/bin/
**/Updater/obj/

# Setup projects
**/Setup/**/Debug/
**/Setup/**/Release/
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/windows/bin/Debug/net10.0-windows/NasaPicOfDay.dll",
"args": [],
"cwd": "${workspaceFolder}/windows",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.preferCSharpExtension": true
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/windows/NasaPicOfDay.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/windows/NasaPicOfDay.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/windows/NasaPicOfDay.sln"
],
"problemMatcher": "$msCompile"
}
]
}
104 changes: 102 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,111 @@
NPOD
====

NASA Pic of the Day
NASA Picture of the Day - Automatically update your desktop wallpaper with stunning astronomy images from NASA's APOD (Astronomy Picture of the Day) service.

For more information check out the [website](http://billcacy.github.io/NPOD).

There's still some work left to be done on both the Mac and Windows apps. Check out our list of things left to do in pivotal tracker and feel free to work on them. Just submit a pull request with your code updates, and what it addresses.
## Features

- Automatically downloads NASA's Astronomy Picture of the Day
- Sets downloaded images as your desktop wallpaper
- Saves all images to your Pictures folder for later viewing
- Runs silently via scheduled task - no background processes needed
- Built on modern .NET 10 with NASA's official APOD API

## Windows Application

### Requirements
- Windows 10 or later
- .NET 10 Runtime ([Download here](https://dotnet.microsoft.com/download/dotnet/10.0))
- Internet connection

### Installation

1. **Clone the repository:**
```bash
git clone https://github.com/OscarHickman/NPOD.git
cd NPOD/windows
```

2. **Run the setup script:**
```powershell
.\Setup-ScheduledTask.ps1
```

This will:
- Build the application in Release mode
- Create a Windows Scheduled Task that runs daily at 12:00 PM
- Configure automatic wallpaper updates

### Usage

**Automatic Mode (Default):**
Once installed, the application runs automatically every day at 12:00 PM to update your wallpaper. No user interaction needed!

**Manual Mode:**
Run the app manually anytime:
```powershell
.\bin\Release\net10.0-windows\NasaPicOfDay.exe -silent
```

**System Tray Mode:**
Run without the `-silent` flag to use the classic system tray icon with menu options:
```powershell
.\bin\Release\net10.0-windows\NasaPicOfDay.exe
```

### Where Are Images Saved?

All downloaded NASA images are saved to:
```
%USERPROFILE%\Pictures\NASA\PicOfTheDay\
```

### Build from Source

```bash
cd windows
dotnet build -c Release
```

The compiled application will be in `bin\Release\net10.0-windows\`

### Uninstall

To remove the scheduled task:
```powershell
Unregister-ScheduledTask -TaskName "NPOD-DailyWallpaper" -Confirm:$false
```

## Mac Application

The Mac version is located in the `mac/` folder. See [mac/README.md](mac/README.md) for installation instructions.

## Development

Contributions are welcome! Feel free to submit pull requests for bug fixes or new features.

[**Mac todos**](https://www.pivotaltracker.com/n/projects/809635)<br />
[**Windows todos**](https://www.pivotaltracker.com/n/projects/809637)

## Technical Details

### Architecture
- **Language:** C# (.NET 10)
- **UI Framework:** Windows Forms (for system tray mode)
- **HTTP Client:** Modern HttpClient with async/await
- **JSON Serialization:** System.Text.Json
- **API:** NASA APOD (Astronomy Picture of the Day)

### API Usage
The application uses NASA's public APOD API:
```
https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&hd=true
```

Note: The DEMO_KEY is rate-limited. For production use, [get your own free API key](https://api.nasa.gov/).

## License

See [LICENSE](LICENSE) file for details.
66 changes: 0 additions & 66 deletions UpdateJsonImage.txt

This file was deleted.

30 changes: 0 additions & 30 deletions UpdatedJson.txt

This file was deleted.

32 changes: 32 additions & 0 deletions windows/ApodImage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Text.Json.Serialization;

namespace NasaPicOfDay
{
public class ApodImage
{
[JsonPropertyName("copyright")]
public string Copyright { get; set; }

[JsonPropertyName("date")]
public string Date { get; set; }

[JsonPropertyName("explanation")]
public string Explanation { get; set; }

[JsonPropertyName("hdurl")]
public string HdUrl { get; set; }

[JsonPropertyName("media_type")]
public string MediaType { get; set; }

[JsonPropertyName("service_version")]
public string ServiceVersion { get; set; }

[JsonPropertyName("title")]
public string Title { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}
}
Loading