"""
Every article consists of 10 lines
-- Why the Law and Tech Aren't Friends on MySpace ID:314
10/06/2009
++ surveillance ++ SocialNetwork ++ travail ++ écoutes ++ GigEconomy
By Nicholas Thompson. There's a fascinating case coming to the New Jersey courts in early June about a bartender and waitress at a restaurant who were sacked because of comments they made in a private MySpace forum. The two created a private group in which they vented about management at Houston's restaurant in Hackensack, NJ. They sent out invitations to friends to join the group, and those people then needed to log in with their email addresses and passwords. Management found out about the group and, according to the plaintiff's complaint, strong-armed one group member into sharing her password. After executives in the company read the comments in the group, they sacked the waitress and the bartender. I called two very smart lawyers to ask about this case "” Wendy Seltzer and Lewis Maltby "” and learned some interesting facts. First, there's little doubt that management had the absolute right to fire the pair. Workers have a few federal protections from being discharged "” you can't be fired because of your race or religion, for example, and, in some cases, you can't be fired for trying to start a union "” but none of these apply here. And there are a handful of states that protect a worker from being fired for issues not related to work. But New Jersey is not one of them. You can quit for any reason you want and in most states you can be fired for almost any reason they want. So the plaintiffs don't have a case that they were wrongfully discharged, and they don't have a case that their free speech rights were violated. The government can't penalize you for saying something because of the free speech is protected by the U.S. Constitution. But since your boss can fire you for no reason, there's no sanctuary for workers in the 1st Amendment. Nonetheless, the two former restaurant employees do have a strong case that their privacy was violated, which means that they may be able to win a suit asking for damages from the restaurant. They made the comments in what is ca
lled an "access controlled space" and they had a reasonable expectation that what they said would remain private. Furthermore, they did all this on their home computers, using home networks and internet access. In fact, according to Maltby, all of the employees who had posted to the group, and who had their postings viewed by management, may be able to file a class action suit against management. Management's actions might actually also run afoul of federal wiretapping laws, which protect private electronic communications. And that's where this case gets weird. Wiretapping? Well, yes, I suppose. You can claim that there was a violation under the way the laws were written, as the plaintiffs do. But wiretapping laws weren't written for cases like this, and the punishments that violating them leads to doesn't seem quite right for the violation in this case. Ultimately, it seems like the ultimate conclusion is a strange one: Restaurant management cannot get punished for the really bad thing they did (firing employees based on their private chatting) but they can be punished severely for reading a private MySpace forum where "” come on "” everyone knew there was some risk that the comments would get out. In other words, there's justice; but it's going to come about in a roundabout way. And that's often the way this sort of thing happens when technology and the law collide. This is a classic case of something that Lawrence Lessig talked about way back in Code: the law can't keep pace with technology. There aren't good statutes, and there isn't good case law, for dealing with social networking sites. And if we do ever pass statutes, it'll be long after MySpace has either become obsolete or completely changed. Technology just changes faster than the law can. Can the law catch up? Of course not. Which means we're going to end up with more cases like this, where statutes designed for one thing get applied to cases about something else entirely. Sometimes that's a good thing.
If it were not for the artful application of the Constitution's Commerce Clause, for example, the landmark Civil Rights Act of 1964 which outlawed racial segregation in schools, public places, and employment would not have passed judicial muster. But, for the most part, law applied in weird ways makes for bad law. I discussed this case the other day on American Morning.
Source: http://www.wired.com/epicenter/ + http://www.wired.com/epicenter/2009/05/why-the-law-and-tech-arent-friends-on-myspace
"""
import datetime
import re
path = 'sample.txt'
def getTitle (line):
m = re.match(r'^-- (.+)$', line)
if m:
return m.group(1)
return None
# Returns date object
def getDate (line):
m = re.match(r'(\d{,2})/(\d{,2})/(\d{4})', line)
if m:
return datetime.date(int(m.group(3)), int(m.group(2)), int(m.group(1)))
# Returns list of keywords
def getKeywords (line):
keywords = re.split(r'\+\+\s', line)
return [k.strip() for k in keywords if k]
# Returns tuple (sourcename, sourceurl)
def getSource (line):
m = re.match('source: (.+) \+ (.+)', line, re.I)
if m:
return (m.group(1), m.group(2))
pass
articles = []
with open(path, 'r') as h:
lines = h.readlines()
linecount = len(lines)
for o in range(0, linecount, 10):
if linecount - o >= 8:
articles.append({
'title': getTitle(lines[o]),
'date': getDate(lines[o + 2]),
'keywords': getKeywords(lines[o + 4]),
'text': lines[o + 6],
'source': getSource(lines[o + 8])
})
print(articles)