Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Andreas Robichaux
2,426 PointsHow do I write a script to get this data from the FCC?
I am trying to use the skillset we learned in Making a Weather app to query the FCC database of licenses and return any radio stations within a certain distance of the user. The link they have says that the data files are so big many programs cannot open it (and i have not been able to) but if you are writing a script to extract the data to use the length provided. So that has me wondering how I can write a script to get the fields I need?
I'm assuming all I'd need would be callsign, frequency, and the coordinates to know if it is near or not? and a genre if they have it but it doesnt seem like they do.
really i know this is random but I really want to make this work so any help is really really appreciated!!!!
so far and I was querying a lowpower FM api but still having an error, then i realized it was not all the stations so i kinda gave up and started looking around and found these.
https://www.fcc.gov/developers/license-view-api https://www.fcc.gov/encyclopedia/fm-service-contour-data-points
3 Answers

Zuhayr Elahi
2,582 PointsSo if you want to write a script, one alternative is to write the script in Groovy. Gradle supports Groovy which is scripting language. So what might help you is to write a small groovy script which does what you asked and have it in a grade file. Either the build.gradle or separate gradle file and invoke it in the build.gradle . I hope this answers your question.
Now that is if you want to do it in a script. Here is the link to Groovy: http://www.groovy-lang.org/learn.html
Now I haven't really tested this. But I found something that might help. Apparently Groovy 2.4 now supports Android. This means that you can write scripts in Android (or I think.). Here is a link:
http://www.mscharhag.com/2015/02/creating-android-apps-with-groovy.html
Anyways I hope this helps. And if you do try the 2nd method and it worked for you, it would be great if you could share that info as I would love to see it work.

Andreas Robichaux
2,426 PointsWhat if I use an html query link they have to dynamically change the URL to based on their longitude and latitude. how do i then get it to JSON?

Andreas Robichaux
2,426 Pointsim so out of my league ha i dont even know where to start
Andreas Robichaux
2,426 PointsAndreas Robichaux
2,426 PointsI was able to get the data I need into an excel spreadsheet I believe and then used an online converter to make a ,json file. So now where do I upload it to, or can it stay in the app local folder and be accessed ?
and if so lets say I upload my json file, radioData.json to my domain... www.dredaycreative.com/radioData/radioData.json do I just use that URL to in the place of what I was using before to query this low powered FCC database??
'''
package com.dredaydesigns.radiostationfinder;
import android.R; import android.app.Activity; import android.location.Location; import android.os.Bundle; import android.util.Log; import android.widget.TextView;
import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationServices; import com.squareup.okhttp.Call; import com.squareup.okhttp.Callback; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response;
import org.json.JSONException; import org.json.JSONObject;
import java.io.IOException;
public class MainActivity extends Activity implements GoogleApiClient.ConnectionCallbacks {
}
'''