-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
145 lines (114 loc) · 5.16 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
include_once( 'config.php' );
include_once( 'view/server/php/class.template.php' );
include_once( 'model/server/php/class.outside.php' );
include_once( 'model/server/php/goodReads.php' );
include_once( 'model/server/php/twitter-api-php/TwitterAPIExchange.php' );
include_once( 'model/server/php/phpFlickr.php' );
if ( $location != 'local' ) {
$memcache = new Memcache;
}
$goodReads = new goodReads( $goodreads_token, $goodreads_user_id, $goodreadsOptions, true);
$books = $goodReads->getShelf();
$twitter = new TwitterAPIExchange( $twitterSettings );
$flickr = new phpFlickr( FLICKR_API );
$elsewhere = new Outside;
$template = new Template;
// First output our page header
$template->outputHTML( "<html xmlns='http://www.w3.org/1999/xhtml' xmlns:fb='http://ogp.me/ns/fb#'><head>\n" );
$template->outputMeta( $template->meta );
$template->outputHTML( "<title>" );
$template->outputString( "Paul Weinstein" );
$template->outputHTML( "</title>" );
$template->outputlink( $template->link );
// Now we move onto the HTML body
$template->outputHTML( "</head><body>" );
$template->outputHTML("
<div class=\"window\">
<div class=\"bar title\">
<h1>WWW.WEINSTEIN.ORG</h1>
<nav>
<ul>
<li class=\"close\"></li>
</ul>
</nav>
</div>
<div class=\"msg\">
<p style=\"text-align:right\">23rd May 2018</P>
<p>What is Old is New (Again)</p>
<p>It is hard to believe that I’ve been maintaining a personal website in one form or another for over 20 years. Or that almost 10 years has passed since I last reorganized and redesigned it. Or that 3 years have passed since the last blog entry.</p>
<p>So here we are, the beginning of something new. Not sure exactly where this will end up, but here we go, the beginning of something new.</p>
<p>Meanwhile, elsewhere on the web…</p>
<p><ul>
<li><a href=\"http://pdw.weinstein.org/about/index.html\" alt\"Personal Blog\">Blog</a></li>
<li><a href=\"https://www.github.com/pdweinstein\" alt\"GitHub\">GitHub</a><ul><li>Latest Commit:
");
if ( $location != 'local' ) {
if ( !$githubEvents = $memcache->get( 'hub_pdw' )) {
$githubEvents = $elsewhere->getGitHubEvents();
$memcache->set( 'hub_pdw', $githubEvents );
}
}
$GHrecent = $githubEvents[0];
$template->outputHTML( "<a href=\"https://www.github.com/" .$GHrecent->repo->name. "/commit/" .$GHrecent->payload->commits[0]->sha. "\">" .substr( $GHrecent->payload->commits[0]->sha, 0, 6 ). "</a> to repository <a href=\"https://www.github.com/" .$GHrecent->repo->name. "\">" .$GHrecent->repo->name. "</a>" );
$template->outputHTML("
</li></ul>
<li><a href=\"https://www.goodreads.com/author/show/193451.Paul_Weinstein\" alt\"Goodreads\">Goodreads</a> <ul> <li> Latest Reading:
");
$book = $books[0];
$template->outputHTML( "<a href='" .$book->link. "' alt='" .$book->title. "'> " .$book->title. " </a>");
$template->outputHTML("
</li></ul>
<li><a href=\"https://plus.google.com/u/0/104233578006014995011\" alt\"Google+\">G+</a></li>
<li><a href=\"https://www.facebook.com/pdweinstein\" alt\"Facebook\">Facebook</a></li>
<li><a href=\"https://www.flickr.com/photos/pdweinstein\" alt\"Flickr\">Flickr</a><ul><li>Latest Image:
");
$recent = $flickr->people_getPublicPhotos( FLICKR_USER );
$template->outputHTML( "<a href='https://www.flickr.com/photos/pdweinstein/" .$recent['photos']['photo'][0]['id']. "/in/photostream/' alt='" .$recent['photos']['photo'][0]['title']. "'>" .$recent['photos']['photo'][0]['title']. "</a>");
$template->outputHTML("
</li></ul>
<li><a href=\"https://www.linkedin.com/in/pdweinstein\" alt\"LinkedIn\">LinkedIn</a></li>
<li><a href=\"https://www.reddit.com/user/pdweinstein\" alt\"Reddit\">Reddit</a></li>
<li><a href=\"https://twitter.com/pdweinstein\" alt\"Twitter\">Twitter</a><ul><li>
");
// Check cache first
if ( $location != 'local' ) {
if ( !$tweets = $memcache->get( 'tweets_pdw' )) {
$tweets = json_decode( $twitter->setGetfield( $getfield )
->buildOauth( $twitterURL, $requestMethod )
->performRequest() );
// Set cache
$memcache->set( 'tweets_pdw', $tweets );
}
} else {
$tweets = json_decode( $twitter->setGetfield( $getfield )
->buildOauth( $twitterURL, $requestMethod )
->performRequest() );
}
$tweet = $tweets[0];
$template->outputHTML( "<a href='https://twitter.com/pdweinstein/status/" .$tweet->id_str. "' alt='" .$tweet->text. "'> Latest Tweet:</a> " .$tweet->text. "</li></ul>");
$template->outputHTML("
<li><a href=\"https://www.youtube.com/user/pdweinstein\" alt\"YuouTube\">YouTube</a></li>
</ul></p>
<p>- Paul </p>
</div>
</div>
<nav class=\"navbar fixed-bottom navbar-light bg-light\">
<p>
]LOAD WWW.WEINSTEIN.ORG <br/> ]RUN <br/> COPYRIGHT PAUL WEINSTEIN (c) 1997 - 2018
</p>
</nav>
");
// Put JS load code at end of doc to keep everything quick for
// page load
$template->outputJS( $template->js );
// Local JS code
echo "<script>
$(\".window\").draggable().resizable({
resize: function(event, ui) {
$(this).css({left:'20%'});
}
});
</script>";
$template->outputHTML( "</body></html>" );
?>