Permalink
Browse files

Added explanation of validator to readme

  • Loading branch information...
Sonictherocketman committed Jun 2, 2015
1 parent 1c83bdb commit 039e21cde808e4c19b75fdb9299e49614918c13c
Showing with 17 additions and 4 deletions.
  1. +4 −0 README.markdown
  2. +13 −4 feed.py
View
@@ -66,6 +66,10 @@ Information regarding world events, social injustice, and social upheaval is jus
True, but the Open Microblogger Standard allows for more social interaction and functionality than the broadcast-only medium that is RSS. Open Microblogger is meant to supplement RSS as another means of communicating. You'll see further down, there is a lot that Open Microblogger can do that RSS just can't. Plus Open Microblogger aims to be as RSS compliant as possible and should be compatible in most RSS readers already.
## Is there a validator I can use?
Why yes. Included with this repository is a very simple validator written in Python.
## How does it work?
Open Microblog is an extension on the RSS XML format that models a user's interactions and status updates. A user's public data, on any given service, is laid out in 3 XML files: the user's Feed, their block list, and their following list.
View
17 feed.py
@@ -5,7 +5,7 @@
http://openmicroblog.com
author: Brian Schrader
since: 2015-05-19
since: 2015-06-01
standard-version: 0.5
"""
@@ -218,6 +218,15 @@ def __init__(self, raw_text=''):
if __name__ == '__main__':
import requests
feed = MainFeed(raw_text=str(requests.get('http://localhost:5000/jjjschmidt/feed.xml').text))
print '{} says {}'.format(feed.username, feed.items[-1].description)
import sys, requests
try:
url = sys.argv[1]
except IndexError:
print 'You must include a url to validate.'; sys.exit(0)
feed = MainFeed(raw_text=str(requests.get(url).text))
if len(feed.items) > 0:
description = feed.items[-1].description
print '\n{} says, "{}"'.format(feed.username, description)
else:
print '\n{} hasn\'t said anything yet.'.format(feed.username)

0 comments on commit 039e21c

Please sign in to comment.