https://github.com/suomato/hubspot-rss-parser
Parsing HubSpot rss-feed and turning it into Array of PHP objects
https://github.com/suomato/hubspot-rss-parser
hubspot parser rss-feed
Last synced: 12 months ago
JSON representation
Parsing HubSpot rss-feed and turning it into Array of PHP objects
- Host: GitHub
- URL: https://github.com/suomato/hubspot-rss-parser
- Owner: suomato
- License: mit
- Created: 2018-07-13T11:14:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-14T18:16:43.000Z (almost 8 years ago)
- Last Synced: 2025-03-13T20:47:58.958Z (over 1 year ago)
- Topics: hubspot, parser, rss-feed
- Language: PHP
- Homepage: https://packagist.org/packages/suomato/hubspot-rss-parser
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HubSpot rss-feed Parser
> This library is for parsing HubSpot rss-feed to PHP Object.
## Installation
```
composer require suomato/hubspot-rss-parser
```
## Example
```
// HubSpot blog RSS feed URL
$rss_feed = 'path/to/rss.xml'
$parser = new Suomato\HubspotParser($rss_feed);
// Array of HubspotPost objects
$posts = $parser->get();
// The First Post Title
$posts[0]->title;
// The First Post link
$posts[0]->link;
// The First Post Image Source
$posts[0]->image['src'];
// The First Post Image alt text
$posts[0]->image['alt'];
// Array of Categories of the First Post
$posts[0]->categories;
```
## Filtering Posts
### Include
```
// Only get posts with categories 'foo' OR 'bar'
$posts = $parser->get([
'include' => ['foo', 'bar']
]);
```
### Exclude
```
// Only get posts without categories 'foo' OR 'bar'
$posts = $parser->get([
'exclude' => ['foo', 'bar']
]);
```
### Limit
```
// Only get first three posts
$posts = $parser->get([
'limit' => 3
]);
```
### Offset
```
// Skips first three posts
$posts = $parser->get([
'offset' => 3
]);
```