Skip to content

Commit

Permalink
fix(afdian): temporarily replace afdian domain
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Jul 20, 2024
1 parent 1b26da0 commit 3ff7431
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Supports:
- [**GitHub Sponsors**](https://github.com/sponsors)
- [**Patreon**](https://www.patreon.com/)
- [**OpenCollective**](https://opencollective.com/)
- [**Afdian**](https://afdian.net/)
- [**Afdian**](https://afdian.com/)
- [**Polar**](https://polar.sh/)

## Usage
Expand Down Expand Up @@ -40,9 +40,9 @@ SPONSORKIT_OPENCOLLECTIVE_GH_HANDLE=
SPONSORKIT_OPENCOLLECTIVE_TYPE=

; Afdian provider.
; Get user_id at https://afdian.net/dashboard/dev
; Get user_id at https://afdian.com/dashboard/dev
SPONSORKIT_AFDIAN_USER_ID=
; Create token at https://afdian.net/dashboard/dev
; Create token at https://afdian.com/dashboard/dev
SPONSORKIT_AFDIAN_TOKEN=

; Polar provider.
Expand Down
4 changes: 2 additions & 2 deletions src/providers/afdian/get-monthly-orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function fetchAfdianMonthlySponsors(
throw new Error('Afdian web auth_token are required')

const orders: any[] = []
const ordersApi = 'https://afdian.net/api/my/sponsored-bill-filter'
const ordersApi = 'https://afdian.com/api/my/sponsored-bill-filter'
let page = 1
let has_more
do {
Expand Down Expand Up @@ -94,7 +94,7 @@ export async function fetchAfdianMonthlySponsors(
login: userId,
name,
avatarUrl,
linkUrl: `https://afdian.net/u/${userData.id}`,
linkUrl: `https://afdian.com/u/${userData.id}`,
},
// all_sum_amount is based on cny
monthlyDollars: userData.plans.every((plan: any) => plan.isExpired)
Expand Down
2 changes: 1 addition & 1 deletion src/providers/afdian/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { $fetch } from 'ofetch'
import type { Provider, SponsorkitConfig, Sponsorship } from '../../types'
import { fetchAfdianMonthlySponsors } from './get-monthly-orders'

// afdian api docs https://afdian.net/p/9c65d9cc617011ed81c352540025c377
// afdian api docs https://afdian.com/p/9c65d9cc617011ed81c352540025c377

export const AfdianProvider: Provider = {
name: 'afdian',
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ export interface ProvidersConfig {
*
* Will read from `SPONSORKIT_AFDIAN_USER_ID` environment variable if not set.
*
* @see https://afdian.net/dashboard/dev
* @see https://afdian.com/dashboard/dev
*/
userId?: string
/**
* Afdian Token that have access to your sponsorships.
*
* Will read from `SPONSORKIT_AFDIAN_TOKEN` environment variable if not set.
*
* @see https://afdian.net/dashboard/dev
* @see https://afdian.com/dashboard/dev
* @deprecated It's not recommended set this value directly, pass from env or use `.env` file.
*/
token?: string
Expand Down

0 comments on commit 3ff7431

Please sign in to comment.