Angular directive tweets display.
Idea is to provide a tweet listing for you website.
I have made some tests using angular
http service to query Twitter API (authentication, query) and it works. But at the end
, I have faced CORS issues, and it was just working on localhost.
So one thing you need to do on your own is the server side.
npm install ng-twitter
How to use it
You should already have script required for Angular, note
sanitize module use.
to the list above, you should add:
ngTwitter in your application module:
and then just add an
tweets directive name attribute,
hashtag scope variable attribute.
'hashtag' is your default hashtag search value.
$scopehashtag = 'football';
hashtag: scope hashtag string variable object, default 'football'
button: show refresh button, default true
hash: show hash input field, default true
count: number of tweets to show, default 15
refresh: refresh time in seconds
Example with all above features:
If you look at the code, module provide one angular service, here is the service side call with
$http. So, for your needs, just play with it.
// TWEETER PROXY SERVICE
You can run the tests by running
assuming you already have
grunt installed, otherwise you also need to do:
npm install -g grunt-cli
The MIT License (MIT)
Copyright (c) 2013 Julien ValÃ©ry
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.