sarnesjo-twhere 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ ---
2
+ :twhere:
3
+ :locations_file: /path/to/locations.yml
4
+ :template_file: /path/to/template.html.erb
5
+ :tweets_file: /path/to/tweets.yml # optional, default is null
6
+ :twitter:
7
+ :username: changeme
8
+ :password: changeme
9
+ :google_maps:
10
+ :api_key: changeme
@@ -0,0 +1,4 @@
1
+ ---
2
+ cairo: 30.058, 31.229
3
+ stockholm: &center 59.35, 18.066667
4
+ center: *center
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>Twhere</title>
6
+
7
+ <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<%= @google_maps_api_key %>" type="text/javascript">
8
+ </script>
9
+
10
+ <script type="text/javascript">
11
+ function initialize() {
12
+ if(GBrowserIsCompatible()) {
13
+
14
+ function createMarker(latlng, name) {
15
+ var marker = new GMarker(latlng);
16
+ marker.value = name;
17
+ GEvent.addListener(marker,"click", function() { map.openInfoWindowHtml(latlng, name); });
18
+ return marker;
19
+ }
20
+
21
+ var points = new Array();
22
+ <% for location, latlng in @locations %>
23
+ points["<%= location %>"] = new GLatLng(<%= latlng %>);
24
+ <% end %>
25
+
26
+ var map = new GMap2(document.getElementById("map"), {mapTypes: [G_PHYSICAL_MAP]});
27
+
28
+ <% for location, tweets in @located_tweets %>
29
+ <% text = tweets.sort {|a, b| -(a[:twitter_id].to_i <=> b[:twitter_id].to_i) }.map {|t| t[:text]}.join("<br />") %>
30
+ map.addOverlay(createMarker(points["<%= location %>"], "<h1><%= location %></h1><p><%= text %></p>"));
31
+ <% end %>
32
+
33
+ map.setCenter(points["center"], 13);
34
+ map.setUIToDefault();
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style>
40
+ *
41
+ {
42
+ border: 0px;
43
+ margin: 0px;
44
+ padding: 0px;
45
+ }
46
+ html, body
47
+ {
48
+ width: 100%;
49
+ height: 100%;
50
+ }
51
+ </style>
52
+
53
+ </head>
54
+
55
+ <body onload="initialize()" onunload="GUnload()">
56
+ <div id="map" style="width: 100%; height: 100%"></div>
57
+ </body>
58
+
59
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sarnesjo-twhere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jesper S\xC3\xA4rnesj\xC3\xB6"
@@ -11,8 +11,17 @@ cert_chain: []
11
11
 
12
12
  date: 2009-04-29 00:00:00 -07:00
13
13
  default_executable: twhere
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: twitter
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
16
25
  description:
17
26
  email: jesper@sarnesjo.org
18
27
  executables:
@@ -23,10 +32,12 @@ extra_rdoc_files:
23
32
  - README.rdoc
24
33
  - LICENSE
25
34
  files:
26
- - README.rdoc
27
- - VERSION.yml
28
35
  - bin/twhere
36
+ - examples/config.yml
37
+ - examples/locations.yml
38
+ - examples/template.html.erb
29
39
  - lib/twhere.rb
40
+ - README.rdoc
30
41
  - LICENSE
31
42
  has_rdoc: true
32
43
  homepage: http://github.com/sarnesjo/twhere
data/VERSION.yml DELETED
@@ -1,4 +0,0 @@
1
- ---
2
- :major: 0
3
- :minor: 0
4
- :patch: 4