
Full-text search for your Twitter archive (Go + AngularJS + PostgreSQL) - paulsmith
http://paulsmith.github.com/tweetarchive/
======
InAnEmergency
Not that this isn't a cool project, but the Twitter archive download comes
with search-by-regular-expression built in, no server or database required.
Just open up the provided index.html.

~~~
don_draper
You're must be one of _those_ people that likes to apply common sense and do
what is easy.

------
GhotiFish
This... is just strange...

Oh well, it seems like a simple example of a Go server, can anyone speak to
the code quality?

I'll say the angularJS isn't so great. No tests are implemented, and only
rudimentary behavior is used.

Op you should use ng-change rather than a watch. those watch's are
irritatingly undependable.

~~~
lucisferre
Wait is ng-change doing something und the hood other than using $watch?

~~~
GhotiFish
Yah. $watch ties into angularJS's model checking scheme. If anything at all
happens in angularJS. It runs through all of the defined watches check
functions to see if they return a different result.

ng-change is an event triggering when the input element changes.

watches can fire multiple times (I think up to 10), if the result of one watch
changes the model, then angular will run all the checks again.

watches have their place on custom directives, but they're otherwise a pain in
the butt.

I _THINK_ this is how it works. I can tell you this with certainty: ng-change
and $watch behave very differently.

~~~
ganarajpr
Actually ng-change is very much same as a $watch.. Here is the relevant source
from Angular..

    
    
      var ngChangeDirective = valueFn({
        require: 'ngModel',
        link: function(scope, element, attr, ctrl) {
          ctrl.$viewChangeListeners.push(function() {
            scope.$eval(attr.ngChange);
          });
        }
      });

~~~
GhotiFish
While you're there, check out line 1033. Where it describes the behavior of
$viewChangeListeners

It triggers on the $setViewValue event. Not on detecting a model change event,
like $watch. They are not the same.

------
madsushi
If you have your own web hosting, Tweet Nest is a great way to archive your
Twitter feed with your own database. It does regular updates (via a cron job)
and has a great display format.

