Give example of howto get members details from a group?

140 zobrazení
Přeskočit na první nepřečtenou zprávu

Ezra Sharp

nepřečteno,
5. 5. 2014 9:18:4005.05.14
komu: steam-c...@googlegroups.com
Here's the code I'm trying and the result.

I can't get the members details (Name, Avater, URL etc), is this a Valve thing or am I doing something wrong?

Sebastian Staudt

nepřečteno,
5. 5. 2014 10:45:0705.05.14
komu: steam-c...@googlegroups.com
Hi.

I'm not sure, but maybe json_encode can't handle the properties of the single SteamId instances from getMembers().

Best regards,
    Sebastian
--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/8f219f75-b361-4b8d-bc98-af281b35d83b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ezra Sharp

nepřečteno,
6. 5. 2014 6:18:0206.05.14
komu: steam-c...@googlegroups.com
Could you post code as how youd dump an array of all the members? even directly dumping getMembers gives me null.


On Tuesday, May 6, 2014 2:45:07 AM UTC+12, Sebastian Staudt wrote:
Hi.

I'm not sure, but maybe json_encode can't handle the properties of the single SteamId instances from getMembers().

Best regards,
    Sebastian

Am Montag, 5. Mai 2014 schrieb Ezra Sharp :
Here's the code I'm trying and the result.

I can't get the members details (Name, Avater, URL etc), is this a Valve thing or am I doing something wrong?

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condenser+unsubscribe@googlegroups.com.
To post to this group, send email to steam-condenser@googlegroups.com.

Sebastian Staudt

nepřečteno,
6. 5. 2014 7:56:5706.05.14
komu: steam-c...@googlegroups.com
Do you mean json_encode() by "dump"?
Try print_r() or var_dump() first to see if getMembers() returns anything useful.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/9a5bf4cd-53ad-450a-84a1-4900a6d81a47%40googlegroups.com.

Ezra Sharp

nepřečteno,
6. 5. 2014 8:23:1006.05.14
komu: steam-c...@googlegroups.com
Var_dump gets me:

array(468) { [0]=> object(SteamCondenser\Community\SteamId)#326 (9) { ["customUrl":"SteamCondenser\Community\SteamId":private]=> NULL ["fetchTime":"SteamCondenser\Community\SteamId":private]=> NULL ["friends":"SteamCondenser\Community\SteamId":private]=> NULL ["games":"SteamCondenser\Community\SteamId":private]=> NULL ["limited":"SteamCondenser\Community\SteamId":private]=> NULL ["nickname":"SteamCondenser\Community\SteamId":private]=> NULL ["playtimes":"SteamCondenser\Community\SteamId":private]=> NULL ["steamId64":"SteamCondenser\Community\SteamId":private]=> string(17) "76561197970526236" ["tradeBanState":"SteamCondenser\Community\SteamId":private]=> NULL }

All the data that is returned is null. Thats why JSON encode displays empty arrays. 

Using the example I pasted earlier can you make your package actually get the members form that group (or any group)?

On Tuesday, May 6, 2014 11:56:57 PM UTC+12, Sebastian Staudt wrote:
Do you mean json_encode() by "dump"?
Try print_r() or var_dump() first to see if getMembers() returns anything useful.

Am Dienstag, 6. Mai 2014 schrieb Ezra Sharp :
Could you post code as how youd dump an array of all the members? even directly dumping getMembers gives me null.

On Tuesday, May 6, 2014 2:45:07 AM UTC+12, Sebastian Staudt wrote:
Hi.

I'm not sure, but maybe json_encode can't handle the properties of the single SteamId instances from getMembers().

Best regards,
    Sebastian

Am Montag, 5. Mai 2014 schrieb Ezra Sharp :
Here's the code I'm trying and the result.

I can't get the members details (Name, Avater, URL etc), is this a Valve thing or am I doing something wrong?

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condenser+unsubscribe@googlegroups.com.
To post to this group, send email to steam-condenser@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/8f219f75-b361-4b8d-bc98-af281b35d83b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condenser+unsubscribe@googlegroups.com.
To post to this group, send email to steam-condenser@googlegroups.com.

Sebastian Staudt

nepřečteno,
6. 5. 2014 10:29:2206.05.14
komu: steam-c...@googlegroups.com
You're using the code from master right? To be honest, I don't know if this is already working in the current code.

I'll try to have a look at it in a few hours.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/d9e40c65-c9bb-424c-8bc5-a7b0afa26beb%40googlegroups.com.

Ezra Sharp

nepřečteno,
6. 5. 2014 17:16:0306.05.14
komu: steam-c...@googlegroups.com
No, the PSR-0 branch, master causes conflicts of Method names in my app. 

Ultimately I want a JSON array of all the members nicknames, Avatar URLs and profile links. But the getMembers command doesn't give the data, it seems I have to call private functions to get the individual details, but I cant even access the steamID64 that is returned by getMembers function. As its un-documented I really don't know what to do. :( 

Do I need to create a new SteamID on each member? Somehow.. 

Sebastian Staudt

nepřečteno,
6. 5. 2014 17:39:1206.05.14
komu: steam-condenser
Uhm sorry, I meant the psr-0 branch.
The code itself is working as expected and this is not a real problem of the library itself. It's a limitation of json_encode.

You may have more luck with something like this: http://jondavidjohn.com/show-non-public-members-with-json_encode




To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/9d97e815-976a-48c1-93b3-0748aa4256a5%40googlegroups.com.

Ezra Sharp

nepřečteno,
6. 5. 2014 18:02:5506.05.14
komu: steam-c...@googlegroups.com
Then why does var_dump also return empty arrays?

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Steam Condenser" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/steam-condenser/YJDX_-Mu3hU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to steam-condens...@googlegroups.com.

To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/CA%2BxP2SZVPkp5_%2Br-tBQqxNh%2Bi_rw%2Ba7LjP-WX5wEni7jrnByjw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--
- Cheers, Ezra.

Sebastian Staudt

nepřečteno,
6. 5. 2014 18:52:3106.05.14
komu: steam-c...@googlegroups.com
Sorry again. Didn't explain that. getMembers() will return “unfetched” SteamId instances. You can get additional data by calling fetch() on each of them. But this requires an additional HTTP request for each one.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.

To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/CA%2B5kQqTrnTjhPNhigYLtiLauq-y5wfrDr9VYVFP1FaYkmJojRA%40mail.gmail.com.

Ezra Sharp

nepřečteno,
6. 5. 2014 19:13:0806.05.14
komu: steam-c...@googlegroups.com
Ok, so 

$members = new StdClass;

foreach(getMembers as $member)
    $members[] = $member->fetch();

return json_encode($members);

Will return a JSON array of the members info? Or do I still need to call other methods (getNickname etc..) on each SteamID instance in that loop? (I can't test it right now)



For more options, visit https://groups.google.com/d/optout.



--
- Cheers, Ezra.

Sebastian Staudt

nepřečteno,
7. 5. 2014 0:08:3107.05.14
komu: steam-c...@googlegroups.com
The properties are private, so json_encode won't “see” them.

For more options, visit https://groups.google.com/d/optout.



--
- Cheers, Ezra.

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/CA%2B5kQqQUb9v%2BDiYUK7wXdg3QPKMVJ_9LTSXwbQ_qR1eH92-KGw%40mail.gmail.com.

Ezra Sharp

nepřečteno,
7. 5. 2014 0:26:1707.05.14
komu: steam-c...@googlegroups.com
Ok I think I'll abandon the JSON idea and push to SQL directly. Will try later. :)
You received this message because you are subscribed to a topic in the Google Groups "Steam Condenser" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/steam-condenser/YJDX_-Mu3hU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to steam-condens...@googlegroups.com.

To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/CA%2BxP2SaZw9GV65XrM_F7-aVQwQc%3D87Kt-yV49OFpkL%3DoZqTVQA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--
- Cheers, Ezra.

Ezra Sharp

nepřečteno,
7. 5. 2014 9:38:5607.05.14
komu: steam-c...@googlegroups.com
It looks like there's a bug on line 159 of lib/SteamCondenser/Community/SteamId.php, $steamId->fetchMembers();

it calls the method "fetchMembers()" on self; which is not in that class or accessible, I think it's meant to be "fetchData()" instead. When I make that in your class, it works.

Ezra Sharp

nepřečteno,
7. 5. 2014 10:20:4007.05.14
komu: steam-c...@googlegroups.com
Once that bug is fixed, this code: http://paste.ubuntu.com/7410681/

does start to pull in the details for each member, however it only pulls in 1 - 2 members deets before giving an XML error. I've checked the XML manually and it all looks fine, do you know what could be happening?

Sebastian Staudt

nepřečteno,
7. 5. 2014 11:00:5907.05.14
komu: steam-condenser
You're right about fetchData(), as mentioned before psr-0 is still WIP.

Can you find which SteamId is failing to parse?



--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.

Ezra Sharp

nepřečteno,
7. 5. 2014 15:28:4107.05.14
komu: steam-c...@googlegroups.com
It seems to be the third one, but calling it on its own works fine. 
You received this message because you are subscribed to a topic in the Google Groups "Steam Condenser" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/steam-condenser/YJDX_-Mu3hU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to steam-condens...@googlegroups.com.

To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/CA%2BxP2SZ6VenZ34sH66jRBxP1x3JFouXn8fJj4WybwF0zAibkAA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--
- Cheers, Ezra.

Ezra Sharp

nepřečteno,
9. 5. 2014 23:31:4409.05.14
komu: steam-c...@googlegroups.com
Sometimes it works and sometimes it does not. Which I know doesn't make sense at the input data is not changing. There must be something wrong with SimpleXMLElement. 

Trying to get the nicknames of these 5 users works sometimes and not others: (This is from a different method, but the same commands)

.:[GH] ルルーシュ Lelouche
Mustard: Sauce
frosty'
CrurrptedGame
Léĝènƌ ĐΔИИУ

Ezra Sharp

nepřečteno,
11. 5. 2014 3:11:3711.05.14
komu: steam-c...@googlegroups.com
I have a feeling that the issue may be a request to Steams servers being rejected maybe the real issue. Its too random to be anything else. I'll test some more. 
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv