• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Dragma

  1. Thanks for the comments. I have not abandoned this project, just low energy from dieting and working out. Parts lists would be a great idea. Goes along with being able to generate your own build part outs.
  2. Thanks. Currently doing a UI redesign as I found having an item a row a bit tedious to scroll through the first week I used it seriously (non testing). I am hoping to have that out in a few weeks.
  3. Whew, it has been a long road, but the latest mile stone is here, a fully stable working version of the first phase of Rebrickable has launched. You may find it here: https://play.google.com/store/apps/details?id=com.coding.dragmas.reinstructable and a page for it here: https://www.facebook.com/Reinstructable There is more to come, much more. I just wanted to get this out before I go to bed.
  4. yep, just keep on pulling till the next param gives you a null value. So similar to this (it is essentially how I do it) while (Next != null) { url = Next Result = API_Call(url) ...Process the result Next = Result.Next } Basic psudo code, but you should get the idea, and this will work no matter how small the page size gets.
  5. Well, looks like I may have bitten off much more then I can chew at this time. Testing was going fine but then I got the bright idea of loading my full collection and the parts, needless to say the app is now bogged down and runs horribly slow. I gots alot more to learn about SQLite on android. As such I have closed down Beta testing (will impact maybe one person) until I can get this running at a satisfactory speed.
  6. The Advent calendar 7907-1 Has one of its sub sets in the main set. Also is missing a pic for one of the days.
  7. Never mind, seems I was using the wrong password, carry on.
  8. I created a new user dragmasoft to test my syncing code, but when I attempt to connect to it, it gives me a 403 error This is from the API page. Is there a time limit that needs to pass? My main account has no problems.
  9. I was hoping for something less destructive and permanent. ah well.
  10. I know how to make a scissor lift (criss cross technic beams or bricks using pins or axles) my question is how to do one using just the thin liftarms so it fits in a 1 stud wide space. I have not found any connectors (axles or pins) that will work
  11. I may have to steal that look. Thanks.
  12. Thanks for pointing this out. I did see there is a property "page_size". so the CURL might be something like: curl -X GET --header 'Accept: application/json' --header 'Authorization: key {MyKey}' 'https://rebrickable.com/api/v3/lego/sets/3731-1/parts/?page_size=1000' Looks like I have more editing to do on my app. Luckly I only currently have 4 users.
  13. Finally got it, sheesh I did not have this much trouble doing it in c#. Anyways if anyone else has the problem: String postData = "username=" + URLEncoder.encode ("*******@***.***") + "&password=" + URLEncoder.encode ("********"); URL url = new URL("https://rebrickable.com/api/v3/users/_token/?key={MyKey}"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestMethod("POST"); // Write body OutputStream output = conn.getOutputStream(); output.write(postData.getBytes()); int statusCode = conn.getResponseCode(); if (statusCode == 200) { InputStream inputStream = new BufferedInputStream(conn.getInputStream()); response = convertStreamToString(inputStream); } output.close(); it seems the key for this method is to build a flat string with the properties and their encoded values instead of doing from a Key / encoded Value pair. In this case the postData looks like: username=******%40*****.***&password=*******
  14. Not bad in the UI, and I would like to know how you did your menu (mine is a bit on the plane side). But what is the use of the app? the way you described it is it sounded a bit like the reverse of mine; where set up a collection of sets and import the elements. I thought yours would be: where you enter all the parts you own then figure out what sets can be built. Just a bit confused.
  15. I would say no, unless you have an android emulator on your PC.
  16. used: WT0H0EJGLK360VE58SXFMNX
  17. there does not seem to be any place for entering a promo code.
  18. I think I may have it, the CURL I get from the test page is: curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Authorization: key {myKey}' -d 'username=********&password=*******' 'https://rebrickable.com/api/v3/users/_token/' it looks like I just need to make sure the username is first, and separated by &, and maybe single quotes surrounding the login and password. I'll test tonight and post my responce. It could help someone else.
  19. Yes the myKey and ****** are to hide my info. And I had tried swapping the "," with "&", And the curly braces with nothing. Though with a clearer head in the morn I may have a few ideas.
  20. Starting over in Android I am once again having some issues: I keep on getting a 403 error with this call, here is the code I am using from Android Studio: url = new URL("https://rebrickable.com/api/v3/users/_token/"); conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Authorization", "key {myKey}"); conn.setRequestMethod("POST"); // Send the post body if (prop.PostData != null) { String postData = prop.PostData.toString(); //example postData: //"{password=******, username=********}" OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream()); writer.write(postData); writer.flush(); } int statusCode = conn.getResponseCode(); if (statusCode == 200) { InputStream inputStream = new BufferedInputStream(conn.getInputStream()); response = convertStreamToString(inputStream); } Any ideas?
  21. My solution is working as well. it looks like the call: https://rebrickable.com/api/v3/lego/sets/<set_num>/parts/ Is using the same query that /api/v3/lego/parts/{part_num}/colors/ and just using the top (1). Hopefully a mod comes out of hiding to peek in here.
  22. Well, I have gotten Reinstructable into open Beta, and it is looking good so far. Search for sets you own from the vast database here on Rebrickable, and then assign locations to the elements within. It now pulls that image locations correctly, the previous method seems to have broken, if the mod is watching this I have posted what I think is the fix in the API section, but no one seems to be paying attention there. I need to add 2 things to move to production: Syncing to the users account here at Rebrickable allow the user to show all the elements listed in the database at once. once those are added, I will move this fully to production, but the additions will not end there...... Planned additions: Allow the user to import loose pieces, and sync those into their Rebrickable account. Breakdown sets to allow the user to filter the element list to a more managable size when rebuilding a set. SET UP MOCS, as well as import them from Rebrickable. Allow the user to sync from other sites as well. as a reminder or those that want to join in the Beta follow the link: https://play.google.com/apps/testing/com.coding.dragmas.reinstructable
  23. Assuming you have gotten a KEY for the API (if not follow the directions here:https://rebrickable.com/api/) then you can construct a URL in Access (using vb) similar to this https://rebrickable.com/api/v3/lego/colors/?key=<*Your Key*> where the <*Your Key*> = the key you had generated. After which it will return a JSON object that you will need to parse out into a vb object, which then you should be able to import into your data base. Here is a thread which should get you started: https://stackoverflow.com/questions/32768235/creating-a-microsoft-access-database-connection-to-a-rest-based-api It will take a bit of work, but is well worth it.
  24. this is why clip pieces tend to have spares in sets. I had the same issue happen on the deloran for the BTTF lego dimensions set.
  25. I think I have found a fix/workaround for this issue, looks like the call for:/api/v3/lego/parts/{part_num}/colors/ is still getting the correct URLs. { "count": 4, "next": null, "previous": null, "results": [ { "color_id": 1, "color_name": "Blue", "num_sets": 1, "num_set_parts": 1, "part_img_url": "https://m.rebrickable.com/media/parts/elements/4612111.jpg", "elements": [ "4612111" ] }, { "color_id": 5, "color_name": "Dark Pink", "num_sets": 1, "num_set_parts": 1, "part_img_url": "https://m.rebrickable.com/media/parts/elements/6056386.jpg", "elements": [ "6056386" ] }, { "color_id": 15, "color_name": "White", "num_sets": 3, "num_set_parts": 4, "part_img_url": "https://m.rebrickable.com/media/parts/elements/4560938.jpg", "elements": [ "4560938" ] }, { "color_id": 72, "color_name": "Dark Bluish Gray", "num_sets": 4, "num_set_parts": 6, "part_img_url": "https://m.rebrickable.com/media/parts/elements/4581526.jpg", "elements": [ "4581526" ] } ] } looks like the part image URL does have the correct info, also it seems for the parts, it is using the 1st one it comes across in: /api/v3/lego/sets/{set_num}/partsat least for the part_image_url and is not properly linked in the query.