Yen to Euro Converter

Convert yen (¥) prices to euros (€) automatically

当前为 2025-07-19 提交的版本,查看 最新版本

作者
enzomtpYT
评分
0 0 0
版本
1.1
创建于
2025-07-19
更新于
2025-07-19
大小
5.3 KB
许可证
暂无
适用于

YtoE - Yen to Euro Converter

A Violentmonkey/Tampermonkey userscript that automatically converts Chinese Yuan (¥) prices to Euros (€) on buff.163.com using real-time exchange rates.

Features

  • Real-time Exchange Rates: Fetches current CNY to EUR rates from a reliable API
  • HTML Structure Support: Handles complex price formats like ¥ 11<small>.7</small>
  • Dynamic Content: Works with both static and dynamically loaded content
  • Fallback Protection: Uses a backup rate if API fails
  • Auto-updates: Monitors page changes and converts new prices automatically

Installation

  1. Install a userscript manager:

  2. Click on the raw script link or copy the script content

  3. Your userscript manager should automatically detect and prompt you to install the script

  4. Enable the script and visit buff.163.com

How It Works

The script automatically detects and converts various yuan price formats:

Simple Format

  • ¥ 3588427.37€
  • ¥ 1,234147.84€

Complex HTML Format (buff.163.com specific)

  • <strong>¥ 11<small>.7</small></strong>1.40€
  • <strong>¥ 2,588<small>.5</small></strong>309.84€

API Integration

The script fetches real-time exchange rates from:

https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/cny.json

Response format:

{
  "date": "2025-07-19",
  "cny": {
    "usd": 0.13925057,
    "eur": 0.11974298
  }
}

Configuration

Updating Exchange Rate Source

To use a different exchange rate API, modify the fetchConversionRate() function:

const response = await fetch('YOUR_API_URL_HERE');

Changing Fallback Rate

Update the fallback rate if needed:

let CONVERSION_RATE = 0.119; // Change this value

Adding More Websites

To use on other websites, add them to the @match directive:

// @match        *://buff.163.com/*
// @match        *://example.com/*

Development

Script Metadata

Key Functions

  • fetchConversionRate(): Gets real-time exchange rates
  • convertYenToEuro(): Performs the currency conversion
  • processElement(): Handles HTML-structured prices
  • processTextNode(): Handles simple text prices
  • walkNodes(): Recursively processes page content

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test on buff.163.com
  5. Submit a pull request

Support

  • Issues: Report bugs on GitHub Issues
  • Updates: Script auto-updates from GitHub
  • Website: buff.163.com compatibility focused

Changelog

v1.1

  • Added real-time exchange rate fetching
  • Improved HTML structure parsing
  • Added support for decimal prices in <small> tags
  • Enhanced error handling and fallback protection

v1.0

  • Initial release
  • Basic yen to euro conversion
  • Static exchange rate
  • buff.163.com support

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址