File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Update RSS
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * *' # every 24 hours
6+ workflow_dispatch : # allow manual run
7+
8+ jobs :
9+ update :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repo
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Node.js
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : 20
20+
21+ - name : Install dependencies
22+ run : npm install
23+
24+ - name : Run scraper
25+ run : node index.js
26+
27+ - name : Move RSS to docs
28+ run : |
29+ mkdir -p docs
30+ mv index.xml docs/index.xml
31+
32+ - name : Commit RSS update
33+ run : |
34+ git config user.name "github-actions"
35+ git config user.email "github-actions@github.com"
36+ git add docs/index.xml
37+ git diff --cached --quiet || git commit -m "Update RSS feed"
38+ git push
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const URL = 'https://apkpure.com/android-device-policy/com.google.android.apps.w
4646
4747 let existingItems = [ ] ;
4848
49- if ( fs . existsSync ( 'rss .xml' ) ) {
49+ if ( fs . existsSync ( 'index .xml' ) ) {
5050 const xmlData = fs . readFileSync ( 'rss.xml' , 'utf-8' ) ;
5151 const parser = new XMLParser ( ) ;
5252 const parsed = parser . parse ( xmlData ) ;
@@ -84,5 +84,5 @@ const URL = 'https://apkpure.com/android-device-policy/com.google.android.apps.w
8484 } ;
8585
8686 const xml = create ( { version : '1.0' , encoding : 'UTF-8' } , rss ) . end ( { prettyPrint : true } ) ;
87- fs . writeFileSync ( 'rss .xml' , xml ) ;
87+ fs . writeFileSync ( 'index .xml' , xml ) ;
8888} ) ( ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments