Fb2RSS

git clone git://xatko.vsos.ethz.ch/Fb2RSS.git
Log | Files | Refs | Submodules | README

Fb2RSS.d (405B)


      1 import std.stdio;
      2 import fbstream;
      3 import std.algorithm: endsWith;
      4 import std.regex;
      5 import std.format;
      6 
      7 void main(string[] args){
      8 	string url=args[1];
      9 	auto reg = ctRegex!`([^:]+)://([^/]+)/(.*)`;
     10 	
     11 	auto m = url.matchFirst(reg);
     12 	if(!m){
     13 		throw new Exception("Not an url");
     14 	}
     15 	url = format("https://m.facebook.com/%s",m[3]);
     16 	
     17 	FBStream str=new FBStream(url);
     18 	str.update();
     19 	str.writeRSS(stdout);
     20 }
     21