Stack2RSS 1.0
A simple web application that creates an RSS feed given an API route.
|
Fetches, parses, and processes API requests. More...
Public Member Functions | |
ProcessFeed () | |
Processes the feed. | |
Private Member Functions | |
CreateFeedData ($items_data, $feed_url) | |
Creates the actual RSS feed data. | |
FetchData ($url) | |
Fetches the raw JSON data from the API for the given URL. | |
GenerateURLFromParameters () | |
Gathers information from parameters and generates a URL. | |
OutputError ($error_str, $status_line='404 Not Found') | |
Returns an error to the client and exits. | |
RunConversion ($json_data) | |
Determines the correct conversion class to instantiate and uses it. |
Fetches, parses, and processes API requests.
Stack2RSS is responsible for parsing the parameters it is passed, fetching the API requests, and finally processing them by creating an instance of the appropriate conversion class and passing along the data.
Stack2RSS::CreateFeedData | ( | $ | items_data, |
$ | feed_url | ||
) | [private] |
Creates the actual RSS feed data.
This function returns the XML for the RSS feed including all of the metadata for the feed.
[in] | $items_data | an array that contians the data (title, HTML) for each item |
[in] | $feed_url | the URL for the API request |
Stack2RSS::FetchData | ( | $ | url | ) | [private] |
Stack2RSS::GenerateURLFromParameters | ( | ) | [private] |
Gathers information from parameters and generates a URL.
This method is responsible for finding all of the parameters that have been passed to the script including the site and constructing the URL that will be passed to FetchData().
Stack2RSS::OutputError | ( | $ | error_str, |
$ | status_line = '404 Not Found' |
||
) | [private] |
Stack2RSS::ProcessFeed | ( | ) |
Stack2RSS::RunConversion | ( | $ | json_data | ) | [private] |