mirror of
				https://github.com/jasm1nii/xml-feed-generator.git
				synced 2025-11-04 08:58:35 +00:00 
			
		
		
		
	Update README.md
This commit is contained in:
		
							parent
							
								
									2013c4edfe
								
							
						
					
					
						commit
						663833c125
					
				
							
								
								
									
										25
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								README.md
									
									
									
									
									
								
							@ -3,16 +3,29 @@ an RSS/atom feed generator for my personal site :cat:
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
the basic logic of this PHP script:
 | 
			
		||||
1. matches files in a specificied directory
 | 
			
		||||
2. parses values retrieved from the following strings/HTML elements, as children of a feed `<entry>`:
 | 
			
		||||
## disclaimer
 | 
			
		||||
### this script is not meant to be used as is.
 | 
			
		||||
expect to do *a lot* of modification to fit your needs, as this was created specifically for my site structure and blog markup.
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## how it basically works
 | 
			
		||||
1. match files in a specificied directory.
 | 
			
		||||
2. load the DOM of each file.
 | 
			
		||||
3. parse values retrieved from the following strings/HTML elements, as children of a feed `<entry>`:
 | 
			
		||||
   -  `<h2>` as `<title>`
 | 
			
		||||
   -  the `datetime` attribute of `<time>` as `<updated>`
 | 
			
		||||
   -  `<element class="p-summary">` as `<summary>`
 | 
			
		||||
   -  `<element class="e-content">` (or `<element class="entry"` for older markup) as `<content>`
 | 
			
		||||
   -  `/path/to/blog/entry` as `<id>`/`<link>`
 | 
			
		||||
3. outputs all of the above to `articles.xml` in another directory.
 | 
			
		||||
4. output all of the above in a new file (named `articles.xml`).
 | 
			
		||||
 | 
			
		||||
for reference, you can check out [the resulting file](https://jasm1nii.xyz/blog/articles/articles.xml) that i've generated myself.
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
feel free to modify according to your needs!
 | 
			
		||||
## usage
 | 
			
		||||
configure a cron job on your server to run this script automatically every now and then, and voila~
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## reference
 | 
			
		||||
feel free to check out [the resulting file](https://jasm1nii.xyz/blog/articles/articles.xml) that i've generated.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user