#silverstripe IRC Log

IRC log for 27 March 2017

All timestamps are in UTC.

1: [00:37:09] * samsamek quit (Quit: samsamek)
2: [00:51:22] * spronk has joined #silverstripe
3: [02:21:03] * Phlunk3 quit (Remote host closed the connection)
4: [02:56:12] * Audlex has joined #silverstripe
5: [03:55:54] * Shrike_Finland has joined #silverstripe
6: [03:56:04] * Shrike_Finland quit (Client Quit)
7: [04:03:23] * Audlex quit ()
8: [04:06:12] * Shrike_Finland has joined #silverstripe
9: [04:34:46] * novaweb has joined #silverstripe
10: [04:35:59] <novaweb> Hi Stripers. Long time. Does anyone know of any younger devs (20-28ish) on the scene who are looking to spread their wings and do some part time silverstripe work?
11: [04:46:54] * Shrike_Finland quit (Quit: Leaving.)
12: [05:24:40] * Shrike_Finland has joined #silverstripe
13: [05:31:49] * sam__ has joined #silverstripe
14: [05:37:13] * sam__ has left #silverstripe
15: [05:51:57] * Shrike_Finland quit (Quit: Leaving.)
16: [05:54:46] <Zauberfisch> novaweb: I think I remember there being a "ss jobs" website and twitter account
17: [05:54:58] <Zauberfisch> you might wanna post it there if it still exists
18: [06:13:42] * spronk quit (Quit: I may need a longer sleep timer...)
19: [08:06:25] * kinglozzer has joined #silverstripe
20: [08:21:48] * DimiStripe quit (Quit: DimiStripe)
21: [08:37:51] * agent44 has joined #silverstripe
22: [09:23:40] * Shrike_Finland has joined #silverstripe
23: [09:42:08] * Shrike_Finland quit (Quit: Leaving.)
24: [10:07:56] * swaiba has joined #silverstripe
25: [10:51:34] * DimiStripe has joined #silverstripe
26: [11:07:17] * DimiStripe quit (Quit: DimiStripe)
27: [11:07:49] * DimiStripe has joined #silverstripe
28: [11:51:23] * Shrike_Finland has joined #silverstripe
29: [12:01:11] * samsamek has joined #silverstripe
30: [12:29:43] * UndefinedOffset has joined #silverstripe
31: [12:34:05] * samsamek quit (Quit: samsamek)
32: [12:36:16] * cloph_away is now known as cloph
33: [12:49:36] * samsamek_ has joined #silverstripe
34: [12:53:27] * samsamek_ quit (Client Quit)
35: [12:54:46] * tryingtogetthis has joined #silverstripe
36: [12:55:01] <tryingtogetthis> Does anyone have experience with APIwesome?
37: [12:58:15] * Shrike_Finland quit (Quit: Leaving.)
38: [13:08:34] * samsamek has joined #silverstripe
39: [13:12:31] * samsamek quit (Client Quit)
40: [14:04:56] * cloph quit (Remote host closed the connection)
41: [14:05:23] * cloph_away has joined #silverstripe
42: [14:10:01] * cloph_away is now known as cloph
43: [14:28:04] * Shrike_Finland has joined #silverstripe
44: [14:40:40] * Shrike_Finland quit (Quit: Leaving.)
45: [14:45:58] * Shrike_Finland has joined #silverstripe
46: [14:55:18] * Shrike_Finland quit (Quit: Leaving.)
47: [15:06:17] * Shrike_Finland has joined #silverstripe
48: [15:23:18] <Zauberfisch> tryingtogetthis: hey
49: [15:23:27] <Zauberfisch> you didn't poke me the other day
50: [15:23:34] <Zauberfisch> APIwesome, never heard of it
51: [15:23:41] <Zauberfisch> are you still looking to parse the json?
52: [15:34:14] <tryingtogetthis> yes I am, I tried that APIwesome and I have my JSON output fine, but cannot figure out why I cant import in on my other page.
53: [15:41:06] <tryingtogetthis> Did you get the feed link I sent Zauberfisch?
54: [15:50:37] <Zauberfisch> can't recall
55: [15:50:40] <Zauberfisch> better send it again
56: [15:50:57] <Zauberfisch> getting the json should be pretty straight forward
57: [15:51:05] <tryingtogetthis> http://epidev.space/epiwebsites/posprogram/apiwesome/retrieve/press-release/json?token=5247f66d990252eb3e32889728f241c108e073268ca6ec543d2f31ce289518dd:wsryvFYDVNsyZcBBVgGDfO
58: [15:51:28] <tryingtogetthis> This is created using that APIwesome. It was incredibly simple.
59: [15:51:43] <Zauberfisch> careful with posting stuff here that is potentially senstive
60: [15:51:48] <Zauberfisch> this is a public and logged channel
61: [15:51:59] <tryingtogetthis> nothing sensitive there
62: [15:52:09] <Zauberfisch> uhm
63: [15:52:10] <tryingtogetthis> I can change the token when it's done.
64: [15:52:12] <Zauberfisch> that's not json
65: [15:52:53] <Zauberfisch> that looks like one of those silly javascript things you do to go around the cross domain policy
66: [15:54:35] <Zauberfisch> or is there something I am missing?
67: [15:55:33] <tryingtogetthis> I have 2 options, JSON, or XML output. They both look like what they should look like (to my understanding).
68: [15:55:55] <Zauberfisch> well, "PressRelease({" is not json
69: [15:55:58] <tryingtogetthis> this being the XML version
70: [15:56:08] <tryingtogetthis> ah, ok
71: [15:56:21] * Shrike_Finland quit (Quit: Leaving.)
72: [15:56:54] <tryingtogetthis> with the API plugin I am using, you get a modeladmin section and I can select exactly what DataObjects I want to be able to output.
73: [15:57:43] <tryingtogetthis> If you have a better suggestion, I am all for it.
74: [15:58:02] <Zauberfisch> is that a requirement?
75: [15:58:14] <Zauberfisch> I would have just hard coded which classes can be exported
76: [15:58:17] <tryingtogetthis> Using this plugin? Not at all.
77: [15:58:25] <Zauberfisch> the whole api is like 10 lines of code
78: [15:59:17] <tryingtogetthis> I was just looking for a solution that was manageable by someone that didn't need access to the code. But if it's more reasonable to keep this hard coded, that is perfectly fine.
79: [16:01:10] <Zauberfisch> do you need all items or just the latest 10 or something?
80: [16:01:42] <tryingtogetthis> All is better
81: [16:01:59] <Zauberfisch> with pagination I presume?
82: [16:02:06] <tryingtogetthis> I can limit in the template in the rare instance I may need to I suppose, or modify the code.
83: [16:02:12] <tryingtogetthis> yeah.
84: [16:02:48] <tryingtogetthis> Would it be done differently than a regular DOS?
85: [16:03:45] <Zauberfisch> DOS?
86: [16:04:02] <tryingtogetthis> dataobjectset
87: [16:04:04] <Zauberfisch> oh, DataObjectSet?
88: [16:04:06] <Zauberfisch> uhm
89: [16:04:10] <Zauberfisch> well
90: [16:04:28] <Zauberfisch> first of all, DataObjectSet is not a thing anymore
91: [16:04:32] <tryingtogetthis> yeah, i know
92: [16:04:36] <Zauberfisch> it's SS_List or DataList now :P
93: [16:04:51] <Zauberfisch> and yes, it would be SS_List compatible
94: [16:04:58] <Zauberfisch> but not a DataList on the other end
95: [16:07:58] <tryingtogetthis> interesting
96: [16:08:08] <Zauberfisch> I would suggest you make it an ArrayList
97: [16:08:51] <tryingtogetthis> That was what I was doing when I was originally pulling the data directly from the DB, the only issue became casting the data. I just couldn't figure it out for the life of me.
98: [16:09:34] <Zauberfisch> but well, getting it from the API it's json
99: [16:09:36] * Shrike_Finland has joined #silverstripe
100: [16:09:38] <Zauberfisch> json can be converted to array
101: [16:09:45] <Zauberfisch> array can be converted to array data
102: [16:10:15] <tryingtogetthis> ahhh, that makes sense
103: [16:12:08] <Zauberfisch> the casting, well, you can wrap values into DBFields
104: [16:12:18] <Zauberfisch> that should acomplish what I think you want
105: [16:12:51] <tryingtogetthis> basically, my date would come back as 2017-01-01 and I couldn't do $Date.Month, it would break it.
106: [16:12:53] <Zauberfisch> (which you can do either way, with API or with pulling it from the database. But pulling it from another sites database is not such a good idea if you ask me. so use an API)
107: [16:13:16] <tryingtogetthis> Yeah, I agree, if I can avoid the DB
108: [16:18:51] * kinglozzer quit ()
109: [16:28:50] <Zauberfisch> tryingtogetthis: what ss version are you using?
110: [16:30:18] <tryingtogetthis> 3.5.2 on both
111: [16:39:02] <Zauberfisch> https://paste.debian.net/hidden/23e76a3c/
112: [16:39:05] <Zauberfisch> https://paste.debian.net/hidden/44f89454/
113: [16:39:08] <Zauberfisch> something like this
114: [16:39:16] <Zauberfisch> first link is the providing site
115: [16:39:24] <Zauberfisch> 2nd link is for the consumer site
116: [16:39:46] <tryingtogetthis> wow man, I can't thank you enough, let me take a crack at this!
117: [16:39:46] <Zauberfisch> I didn't test this code, just wrote it on top of my head, so you might have minor typos here or there
118: [16:40:04] <Zauberfisch> but it should give you a good idea of how to quickly stick together a simple api
119: [16:40:17] <Zauberfisch> one more thing you need to do is give the FoobarController a route
120: [16:41:05] <tryingtogetthis> Those would go into the dataobject controller right?
121: [16:41:18] <Zauberfisch> DataObject Controller?
122: [16:41:40] <tryingtogetthis> for the dataobject I am looking to send out? is that right?
123: [16:41:54] <Zauberfisch> wait what?
124: [16:42:14] <Zauberfisch> FoobarController is it's own controller
125: [16:42:20] <Zauberfisch> that's not a dummy code. just a dummy name
126: [16:42:25] <tryingtogetthis> gotcha
127: [16:42:59] <Zauberfisch> call it BlogExportController or what ever
128: [16:43:36] <Zauberfisch> https://paste.debian.net/924627/ create this as a routes.yml or something in mysite/_config
129: [16:44:04] <Zauberfisch> (basically, do the first paste (23e76a3c) first and then this route
130: [16:44:43] <Zauberfisch> then visit your page with http://epidev.space/epiwebsites/posprogram/FoobarController/blog
131: [16:44:47] <Zauberfisch> it should show you the json
132: [16:52:23] <Zauberfisch> tryingtogetthis: and once you visit that url and you see the json, then proceed to the 2nd paste I sent
133: [16:54:37] <tryingtogetthis> I am getting action 'blog' not allowed
134: [16:54:45] <Zauberfisch> oh
135: [16:54:56] <Zauberfisch> did I not add that to the array allowed_actions?
136: [16:55:04] <Zauberfisch> lol
137: [16:55:06] <Zauberfisch> I am an idiot
138: [16:55:17] <Zauberfisch> wrote the array but did not put the blog in it
139: [16:55:23] <Zauberfisch> private static $allowed_actions = ['blog'];
140: [16:55:24] <tryingtogetthis> its empty, and im an idiot for not seeing it when i read through the code quickly
141: [16:55:30] <Zauberfisch> and then visit again with ?flush=1
142: [16:56:04] <tryingtogetthis> beautiful
143: [16:56:13] <tryingtogetthis> that worked!
144: [16:56:37] <Zauberfisch> lovely
145: [16:56:50] <Zauberfisch> I added the option of pagination
146: [16:57:05] <Zauberfisch> so you can do /FoobarController/blog?limit=10&offset=10 or something
147: [16:58:01] <tryingtogetthis> that is incredible! let me make sure my recieving site works now, and I owe you a nice tall beer
148: [17:02:21] <Zauberfisch> well, I'll be afk for a bit
149: [17:02:47] <Zauberfisch> I'll be back later. let me know if it worked
150: [17:03:04] <tryingtogetthis> I will man, thank you so much!
151: [17:05:27] * agent44 quit (Quit: zzz)
152: [17:07:24] * DarjusIT has joined #silverstripe
153: [17:46:15] * qlex has joined #silverstripe
154: [17:46:26] * qlex has left #silverstripe
155: [18:58:48] * Shrike_Finland quit (Quit: Leaving.)
156: [18:58:56] * Shrike_Finland has joined #silverstripe
157: [18:59:02] * Shrike_Finland quit (Client Quit)
158: [19:23:58] * Audlex has joined #silverstripe
159: [20:05:43] <Zauberfisch> the previous paste 44f89454 contained an error, fixed version: https://paste.debian.net/hidden/ec6a84dd/
160: [20:05:47] <Zauberfisch> tryingtogetthis: ^
161: [20:05:48] <Zauberfisch> try this
162: [20:07:48] <Zauberfisch> see lines 16 and below
163: [20:08:28] <tryingtogetthis> yeah, I see we have to be very specific
164: [20:09:46] <tryingtogetthis> It's throwing me an invalid argument for foreach()
165: [20:10:09] <Zauberfisch> invalid/empty json?
166: [20:17:12] <tryingtogetthis> In the event that someone is not aware, Zauberfisch is a GOD
167: [20:22:03] <Zauberfisch> glad you got it working
168: [20:36:01] * gelignite has joined #silverstripe
169: [21:19:45] * UndefinedOffset quit (Quit: Leaving.)
170: [21:49:11] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
171: [21:52:49] * DarjusIT quit (Quit: Leaving)
172: [23:00:01] * ss-helper quit (Remote host closed the connection)
173: [23:00:15] * ss-helper has joined #silverstripe

These logs were automatically created by ss-log on irc.freenode.net.