Crawling angularjs sites - SEO

1,129 views
Skip to first unread message

Roger Alsing

unread,
Aug 6, 2013, 5:44:03 PM8/6/13
to ang...@googlegroups.com
We have put together a small service for those who want to serve static snapshots of their dyanmic content to google and other serach bots.

e.g. 

This will return the generated html for angularjs.org
(see the two todo items are present there and those are angularjs generated)

You just have to wire up your backend to respond to googles _escaped_fragment_ requests .

pseudo code:

server code:

     if (querystring.containskey("_escaped_fragment_")
     {
            var page = querystring["_escaped_fragment_"];
            var url = "http://www.mysite.com/%23!/" + page;

            var html = httppost("http://crawlr.wombit.se/Crawler/htmlsnapshot?url=" + url);
            response.write(html);
            response.end();
            return;
     }


Sorry if this comes out as promotion or anything, but I build this service to scrape my own angularjs site for search engine indexing.

Maybe someone else have some use for it..

//Roger

Jose Luis Rivas

unread,
Aug 6, 2013, 7:03:27 PM8/6/13
to ang...@googlegroups.com
On 8/6/13 2:44 PM, Roger Alsing wrote:
> We have put together a small service for those who want to serve static
> snapshots of their dyanmic content to google and other serach bots.
>
> e.g.
> http://crawlr.wombit.se/Crawler/htmlsnapshot?url=http://angularjs.org/
>
> This will return the generated html for angularjs.org
> (see the two todo items are present there and those are angularjs generated)
>
> You just have to wire up your backend to respond to googles
> _escaped_fragment_ requests .
>

This is awesome. Did you built it open source? Is the code of the
service available somewhere?


--
Jose Luis Rivas
http://joseluisrivas.net/

dev mondo

unread,
Aug 6, 2013, 9:20:42 PM8/6/13
to ang...@googlegroups.com
great, could you please share source code if it is not a problem

Roger Alsing

unread,
Aug 7, 2013, 12:47:03 AM8/7/13
to ang...@googlegroups.com
Absolutely.

Its pretty simple actually.
I start up PhantomJS inside wombit crawlr and execute a small javascript that loads the page.
The result is then piped from the phantom process back to my app and returned to the client.
I think it's less than 100loc all in all.

I'll set up a repo for it when Im back at work.

dev mondo

unread,
Aug 7, 2013, 6:07:36 PM8/7/13
to ang...@googlegroups.com
cant wait, awesome

Kirk Bushell

unread,
Aug 8, 2013, 2:36:50 AM8/8/13
to ang...@googlegroups.com
What an awesome idea.... Well done!!!

Jeff Lu

unread,
Sep 1, 2013, 8:15:06 AM9/1/13
to ang...@googlegroups.com
This is great. Is the repo available?

Karan Jassar

unread,
Sep 2, 2013, 5:44:05 AM9/2/13
to ang...@googlegroups.com
Here's one I found on Github.

Reply all
Reply to author
Forward
0 new messages