/
index.php
161 lines (124 loc) · 4.62 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
include_once( '../config.php' );
include_once( '../lib/include.php' );
include_once( '../lib/pre.php' );
/*
if ( $location != 'local' ) {
$memcache = new Memcache;
}
$seti = new RPC;
$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\">$latestDate</p>
<p>Latest Post: " .ucfirst( $latest ). "</p>
");
if( $latest == 'flickr' ) {
$template->outputFlickr( $feed['flickr'] );
} elseif( $latest == 'twitter' ) {
$template->outputTweet( $feed['twitter'], 'main' );
} elseif( $latest == 'github' ) {
$template->outputGithub( $feed['github'], 'main' );
} elseif( $latest == 'instagram' ) {
$template->outputInstagram( $feed['instagram'] );
}
$template->outputHTML("
<p>Elsewhere:</p>
<p><ul>
<li><a href=\"/blog/\" alt\"Personal Blog\">Blog</a><ul><li><a href=\"/blog/index.php/2018/05/what-is-old-is-new-again.html\">What is Old is New (Again)</a></li></ul></li>
<!--- <li><a href=\"\">Boinc<ul><li> --->
");
//echo $seti->getResults();
$template->outputHTML("
<li><a href=\"https://www.github.com/pdweinstein\" alt\"GitHub\">GitHub</a><ul><li>Last commit was
");
$template->outputGithub( $feed['github'], 'list' );
$template->outputHTML("
</li></ul>
<li><a href=\"https://www.goodreads.com/author/show/193451.Paul_Weinstein\" alt\"Goodreads\">Goodreads</a> <ul> <li> Currently reading
");
$template->outputHTML( "<a href='" .$book['link']. "' alt='" .$book['title']. "'> " .$book['title']. " </a>");
$template->outputHTML("
</li></ul>
<li><a href=\"https://www.facebook.com/pdweinstein\" alt\"Facebook\">Facebook</a></li>
");
/*
$postData = "";
$userPosts = $fb->get("/526081044/feed", $accessToken);
$postBody = $userPosts->getDecodedBody();
$postData = $postBody["data"];
if (! empty($postData)) {
foreach ($postData as $k => $v) {
$postDate = date("d F, Y", strtotime($postData[$k]["created_time"]));
if(!empty($postData[$k]["message"])) {
echo $postData[$k]["message"];
echo $postDate;
}
}
}
*/
$template->outputHTML("
<li><a href=\"https://www.flickr.com/photos/pdweinstein\" alt\"Flickr\">Flickr</a><ul><li>
");
$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.instagram.com/pdweinstein\" alt\"Instagram\">Instagram</a><ul><li>
");
$template->outputHTML( "<a href='" .$instaData[0]->{'link'}. "' alt='" .$instaData[0]->{'caption'}->{'text'}. "'>" .$instaData[0]->{'caption'}->{'text'}. "</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>
");
$template->outputTweet( $feed['twitter'], 'list' );
$template->outputHTML( "</li></ul>" );
$template->outputHTML("
<li><a href=\"https://www.youtube.com/user/pdweinstein\" alt\"YouTube\">YouTube</a></li>
</ul></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 - 2019
</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>" );
?>