Skip to content

Commit a426b0c

Browse files
committed
fixed Facebook .co domains
1 parent 304c593 commit a426b0c

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/Adapters/Facebook.php

+11-17
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ public function getDescription()
115115
*/
116116
public function getUrl()
117117
{
118-
if ($this->isPost) {
119-
return $this->request->startingUrl->getUrl();
120-
}
121-
122-
return $this->api->get('url') ?: $this->request->startingUrl->getUrl();
118+
return $this->api->get('url') ?: parent::getUrl();
123119
}
124120

125121
/**
@@ -134,41 +130,39 @@ public function getCode()
134130
var js, fjs = d.getElementsByTagName(s)[0];
135131
if (d.getElementById(id)) return;
136132
js = d.createElement(s); js.id = id;
137-
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
133+
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
138134
fjs.parentNode.insertBefore(js, fjs);
139135
}(document, 'script', 'facebook-jssdk'));</script>
140136
141-
<div class="fb-post" data-href="{$this->url}" data-width="500"></div>
137+
<div class="fb-post" data-href="{$this->url}" data-width="{$this->width}"></div>
142138
EOT;
143139
}
144140
}
145141

146142
/**
147143
* {@inheritdoc}
148144
*/
149-
public function getProviderName()
145+
public function getWidth()
150146
{
151-
return 'Facebook';
147+
if ($this->isPost) {
148+
return 500;
149+
}
152150
}
153151

154152
/**
155153
* {@inheritdoc}
156154
*/
157-
public function getAuthorName()
155+
public function getProviderName()
158156
{
159-
return $this->api->get('username') ?: parent::getAuthorName();
157+
return 'Facebook';
160158
}
161159

162160
/**
163161
* {@inheritdoc}
164162
*/
165-
public function getSource()
163+
public function getAuthorName()
166164
{
167-
$id = $this->api->get('id');
168-
169-
if (!empty($id)) {
170-
return 'https://www.facebook.com/feeds/page.php?id='.$id.'&format=rss20';
171-
}
165+
return $this->api->get('username') ?: parent::getAuthorName();
172166
}
173167

174168
/**

0 commit comments

Comments
 (0)