getstream / stream-php Goto Github PK
View Code? Open in Web Editor NEWPHP Client - Build Activity Feeds & Streams with GetStream.io
Home Page: https://getstream.io
License: BSD 3-Clause "New" or "Revised" License
PHP Client - Build Activity Feeds & Streams with GetStream.io
Home Page: https://getstream.io
License: BSD 3-Clause "New" or "Revised" License
Client error: POST https://api.stream-io-api.com/api/v1.0/unfollow_many/?api_key=xxxxxxx
resulted in a 429 Too Many Requests
response:
{ "detail": "Too many requests, check response headers for more information.", "status_code": 429, "code": 9, "exception ": "RateLimitReached", "duration ": "0.00 ms " }
I see that the REST Documentation does not have the v1.0/unfollow_many
documented. I assume this API endpoint was implemented but has been removed again?
https://github.com/GetStream/stream-php/blob/master/lib/GetStream/Stream/Batcher.php#L91
Hello, I want to ask if the 2.1.0 version is still maintained by the GetStream team.
Thank you
Running getstream with Symfony 5.2 on PHP 7.4.
This notice appears frequently:
NOTICE: PHP message: PHP Warning: Use of undefined constant VERSION - assumed 'VERSION' (this will throw an Error in a future version of PHP) in /srv/http/vendor/get-stream/stream/lib/GetStream/Stream/Feed.php on line 67
Best regards.
gz#10568
here is the data being posted to updateActivities() method [which is exactly same when new activity is added]
(
[actor] => admin
[verb] => content_published
[object] => Post: Grading Go Bags
[title] => Grading Go Bags
[started_at] => Array
(
[date] => 2018-08-08 13:42:21.000000
[timezone_type] => 3
[timezone] => UTC
)
[status] => new status on activity update is published
[content_url] => This is test url to see if activity can be updated using this way.
[time] => 2018-07-23 14:30:16
[meta] => Array
(
[post_type] => post
[excerpt] => The quality of earthquake survival kits ranges from solid to shaky. We rated several emergency kits on the market to find the survival bag most likely to come in handy when The Big One hits.
[category] => TOOLS
[story_headline] => Getting Ready for the Big One
[deck_headline] => The quality of earthquake survival kits ranges from solid to shaky
[author] => Beth Spotswood
[thumbnail] => Array
(
[url] => http://localhost/altaonline.com/wp-content/uploads/2018/06/ATA050118starwars_img01.jpg
[alt] =>
)
)
[foreign_id] => 3798
)
and it says 'Invalid JSON Payload with following trace
PHP Fatal error: Uncaught exception 'GetStream\Stream\StreamFeedException' with message '{"detail":"Invalid JSON payload","status_code":400,"code":4,"exception":"InputException","duration":"0.14ms"}' in C:\wamp64\www\altaonline.com\wp-content\plugins\feed-manager\vendor\get-stream\stream\lib\GetStream\Stream\Feed.php:100
Not sure if this is desired behaviour or not, but our assumption was that calling Client::updateActivities
with an empty array would be a no-op rather than making an HTTP call which subsequently fails.
USER_AGENT should be "stream-php-client-$version"
Hi there,
Anybody thinking on giving support for php-jwt ~3.0?
stream-py got this part right by combining UUID and other prefixes to avoid re-using the same feeds (and get previous run pollution)
I want to store reactions as a Laravel eloquent object, so I can enrich it.
How to enrich this data from the feed? I added a model reference in the data field, but i'm not sure if it is possible in this way?
Hi,
I think it should be a great idea to implements interfaces in this project.
We are using the SDK in Symfony, and we are trying to cover our code with some behat tests.
By implementing some interfaces, I could be able to create Dummies of the Feed and the Client objects in my tests.
I Can do a PR for that, do you have any good practice for that? Naming conventions, specific namespace?
I'm also wondering why all the methods are public? Some of them seem to be internal and should be protected/private, no?
I actually get different test failures/errors when I've pulled it to run it locally, which is interesting. But either way, CI isn't much use if tests fail all the time.
secret = the api secret
token = a token for accessing a feed (generated from the secret)
authorization = the header sent for authorization combining the feed name and the token
python, js and ruby do it like this
Get the feed object for aggregated 3 and follow user 1
aggregated3 = client.feed('aggregated:3')
aggregated3.follow('user:1')
vs
// Get the feed object for aggregated 3 and follow user 1
$aggregated3 = $client->feed('aggregated:3');
$aggregated3->followFeed('user:1');
I am getting a feed_slug validation error with this slug: "user-aggregated".
I was able to create this feed from the dashboard and the docs don't mention much about the naming convention.
Issue at: BaseFeed::validFeedSlug
Exception received: StreamFeedException(feed_slug can only contain alphanumeric characters or underscores)
Could you please bump JWT Version again?
We should always use different feed_ids instead of relying on feed delete to cleanup
I am getting this error
Attempted to call function "parse_query" from namespace "GuzzleHttp\Psr7".
I guess I am running the correct versions of Guzzle:
/app# composer info | grep guzzle
guzzlehttp/guzzle 7.3.0 Guzzle is a PHP HTTP c...
guzzlehttp/promises 1.4.1 Guzzle promises library
guzzlehttp/psr7 2.0.0 PSR-7 message implemen...
The PSR7 Repo says that the parse_query
has been replaced by Query::parse
.
eg.
client->setGuzzleDefaultOption('verify', '/absolute/path/to/cacert.pem');
Same thing we do for feed->get
https://github.com/GetStream/stream-php/blob/master/lib/GetStream/Stream/BaseFeed.php#L206
For debugging I'd like to be able to log out all requests and responses from the Stream API to a file, would it be possible to expose the Guzzle client in some way so we can add additional log handlers, etc?
More of an inconsistency than anything else, but when passing options to a notification feed, the documentation states the same for both mark_seen
and mark_read
:
NAME DESCRIPTION
mark_read Comma separated list of activity ids to mark as read, or boolean true
mark_seen Comma separated list of activity ids to mark as seen, or boolean true
And the code example given shows this being achieved with an array rather than a string:
# Mark some activities as read
$options = array('mark_read' => array('activity_id_1', 'activity_id_2'));
$results = $notification_feed->getActivities(0, 10, $options);
This works fine for mark_read
but does not work for mark_seen
. I believe both should behave the same way.
Example was copied directly from official documentation
Performing upsert() with an array of arrays should batch insert/update many collection items.
Exception is thrown:
Type: GetStream\Stream\StreamFeedException
Message: {"detail":"Error parsing 'data'","status_code":400,"code":4,"except
ion":"InputException","exception_fields":{"data":["Error parsing 'data'"]},"dura
tion":"0.16ms"}
$client->collections()->upsert('visitor', [
[
'id' => '123',
'username' => 'johndoe',
'favorite_color' => 'blue',
]
]);
I did not create a pull request because this solution is not something I've put a lot of thought into regarding performance or compatibility, it's just good enough to work.
public function upsert($collectionName, array $data)
{
$shouldBatch = array_filter($data, 'is_array') === $data;
$response = $this->doRequest('POST', 'collections/', ['data' => [$collectionName => $shouldBatch ? $data : array($data)]]);
$body = $response->getBody()->getContents();
return json_decode($body, true);
}
Hi.
When I use \FeedManager::followUser
in the most recent version I get:
In StreamLaravelManager.php line 93:
Call to undefined method GetStream\Stream\Feed::followFeed()
Guzzle is required, but is specified to be as follows:
"guzzlehttp/guzzle": "6.0.*"
Instead, given that Guzzle follows Semantic Versioning, could this please be changed to the following to ensure maximum compatibility when integrating with large projects?
"guzzlehttp/guzzle": "^6.0"
Hi,
I'm trying to make a request to this url https://www.whoscored.com/?t=Hart, but I'm getting the following error:
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFa in C:\xampp5.6\htdocs\comuniazo-uk\api\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187
I know of course is related with the SSL connection, but I'm kind of lost in this aspect. I've made some search over the internet, but I haven't found a solution for the problem.
Could you help me with this? Some guide on how to solve the problem...
This is the code that make the request:
$client = new Client();
$url = 'http://www.whoscored.com/Search/?t=' . $player["name"];
$crawler = $client->request('GET', $url);
Is there anyway to make the call without a cert?
GetStream\Stream\Signer.php:88 type "string" in php-5.6 doesn't work. It require instance of GetStream\Stream\string.
Hi Guys,
I am getting this cloudfront error similar to MaxTiago's. But I can't seem to fix it. I am assuming, based on MaxTiago's comment, that we need to have our VPS server bind to listen all:
listen-on { any; };
listen-on-v6 { any; };
but it is still not working. Works perfectly on my local machine (XAMPP) as well as our test server in Heroku, but not on our VPS server.
My Acitity
foreign_id - activity:1
time - 2021-04-04T05:47:16.065221Z
$results = $this->client->getActivities(null, [[
'activity:1',
Carbon::parse("2021-04-04T05:47:16.065221Z"),
]]);
If i pass time as "2021-04-04T05:47:16.065221Z", I got "Call to a member function format() on string" error.
So i pass like that "Carbon::parse("2021-04-04T05:47:16.065221Z")"
But i can't get activity because of the wrong time.
I see getstream php library format the time like that.
$times[] = $fit[1]->format(DateTime::ISO8601);
It returns 2021-04-04T10:27:25+0000
If i change your code like below, i can retrieve.
$times[] = $fit[1]->format('Y-m-d\TH:i:s.u');
gz#10834
Fatal error: Uncaught exception 'GuzzleHttp\Exception\ServerException' with message 'Server error response [url] https://10.10.2.32:7071/service/admin/soap [status code] 500 [reason phrase] Server Error' in /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89 Stack trace: #0 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(33): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Message\Response)) #1 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\Subscriber\HttpError->onComplete(Object(GuzzleHttp\Event\CompleteEvent), 'complete') #2 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\Event\Emitter->emit('complete', Object(GuzzleHttp\Event\CompleteEvent)) #3 /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/ in /home/vikatan/www/intrasite/intra.vikatan.com/zimbra/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89
Please help me all.
Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException' with message 'cURL error 60: SSL certificate problem: self signed certificate in certificate chain' in C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126 Stack trace: #0 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(90): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array) #1 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php(78): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array, Array, Resource id #68) #2 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30): GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array) #4 C:\workspace\app\vendor\guzzlehttp\guzzle\src\RequestFsm.php(129): GuzzleHttp\Ring\Cli in C:\workspace\app\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 51
I would appreciate if you could help me get around this error
Steps to reproduce
Add child reaction with target_feed array parameter.
Current Behavior
When i am adding child reaction with target_feed, it returns this error. That i think, in the addChild function which is converting target_feed array to comma separated string. Like this
if( $targetFeeds !== null ){
$payload['target_feeds'] = join(',', $targetFeeds);
}
if i change to this
$payload['target_feeds'] = $targetFeeds;
It is working fine.
Hi,
I see that this project is using 3 abandoned packages:
phpunit/phpunit-mock-objects
guzzle/guzzle
satooshi/php-coveralls
Do you plan to upgrade those dependencies? Do you need help with that?
Message: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /vendor/guzzlehttp/guzzle/src/Client.php on line 87 and defined
the readme and code should explain how to generate a token for usage in the client side API
Hi,
Although in the README file there is a $userFeed->delete() function, it does not exist in the GetStream\Stream\Feed class.
Thanks.
gz#13126
Type: GetStream\Stream\StreamFeedException
Message: ERROR The request could not be satisfied (bad request)Generated by cloudfront (CloudFront)
Filename: .../vendor/get-stream/stream/lib/GetStream/Stream/Feed.php
Line Number: 102
I'm getting this exception when fetching some activities on testing setup (ubuntu, apache 2.4.7, php 7.0.8)
The same code works fine on my local setup (windows, xampp -> php 7.0.6)
I want to use this with zend framework 2 how to do this ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.